173 #ifndef PY_SSIZE_T_CLEAN
174 #define PY_SSIZE_T_CLEAN
178 #error Python headers needed to compile C extensions, please install development version of Python.
179 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
180 #error Cython requires Python 2.6+ or Python 3.3+.
182 #define CYTHON_ABI "0_29_36"
183 #define CYTHON_HEX_VERSION 0x001D24F0
184 #define CYTHON_FUTURE_DIVISION 1
187 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
189 #if !defined(WIN32) && !defined(MS_WINDOWS)
201 #define DL_IMPORT(t) t
204 #define DL_EXPORT(t) t
206 #define __PYX_COMMA ,
207 #ifndef HAVE_LONG_LONG
208 #if PY_VERSION_HEX >= 0x02070000
209 #define HAVE_LONG_LONG
213 #define PY_LONG_LONG LONG_LONG
216 #define Py_HUGE_VAL HUGE_VAL
219 #define CYTHON_COMPILING_IN_PYPY 1
220 #define CYTHON_COMPILING_IN_PYSTON 0
221 #define CYTHON_COMPILING_IN_CPYTHON 0
222 #define CYTHON_COMPILING_IN_NOGIL 0
223 #undef CYTHON_USE_TYPE_SLOTS
224 #define CYTHON_USE_TYPE_SLOTS 0
225 #undef CYTHON_USE_PYTYPE_LOOKUP
226 #define CYTHON_USE_PYTYPE_LOOKUP 0
227 #if PY_VERSION_HEX < 0x03050000
228 #undef CYTHON_USE_ASYNC_SLOTS
229 #define CYTHON_USE_ASYNC_SLOTS 0
230 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
231 #define CYTHON_USE_ASYNC_SLOTS 1
233 #undef CYTHON_USE_PYLIST_INTERNALS
234 #define CYTHON_USE_PYLIST_INTERNALS 0
235 #undef CYTHON_USE_UNICODE_INTERNALS
236 #define CYTHON_USE_UNICODE_INTERNALS 0
237 #undef CYTHON_USE_UNICODE_WRITER
238 #define CYTHON_USE_UNICODE_WRITER 0
239 #undef CYTHON_USE_PYLONG_INTERNALS
240 #define CYTHON_USE_PYLONG_INTERNALS 0
241 #undef CYTHON_AVOID_BORROWED_REFS
242 #define CYTHON_AVOID_BORROWED_REFS 1
243 #undef CYTHON_ASSUME_SAFE_MACROS
244 #define CYTHON_ASSUME_SAFE_MACROS 0
245 #undef CYTHON_UNPACK_METHODS
246 #define CYTHON_UNPACK_METHODS 0
247 #undef CYTHON_FAST_THREAD_STATE
248 #define CYTHON_FAST_THREAD_STATE 0
249 #undef CYTHON_FAST_PYCALL
250 #define CYTHON_FAST_PYCALL 0
251 #if PY_VERSION_HEX < 0x03090000
252 #undef CYTHON_PEP489_MULTI_PHASE_INIT
253 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
254 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
255 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
257 #undef CYTHON_USE_TP_FINALIZE
258 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
259 #undef CYTHON_USE_DICT_VERSIONS
260 #define CYTHON_USE_DICT_VERSIONS 0
261 #undef CYTHON_USE_EXC_INFO_STACK
262 #define CYTHON_USE_EXC_INFO_STACK 0
263 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
264 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
266 #elif defined(PYSTON_VERSION)
267 #define CYTHON_COMPILING_IN_PYPY 0
268 #define CYTHON_COMPILING_IN_PYSTON 1
269 #define CYTHON_COMPILING_IN_CPYTHON 0
270 #define CYTHON_COMPILING_IN_NOGIL 0
271 #ifndef CYTHON_USE_TYPE_SLOTS
272 #define CYTHON_USE_TYPE_SLOTS 1
274 #undef CYTHON_USE_PYTYPE_LOOKUP
275 #define CYTHON_USE_PYTYPE_LOOKUP 0
276 #undef CYTHON_USE_ASYNC_SLOTS
277 #define CYTHON_USE_ASYNC_SLOTS 0
278 #undef CYTHON_USE_PYLIST_INTERNALS
279 #define CYTHON_USE_PYLIST_INTERNALS 0
280 #ifndef CYTHON_USE_UNICODE_INTERNALS
281 #define CYTHON_USE_UNICODE_INTERNALS 1
283 #undef CYTHON_USE_UNICODE_WRITER
284 #define CYTHON_USE_UNICODE_WRITER 0
285 #undef CYTHON_USE_PYLONG_INTERNALS
286 #define CYTHON_USE_PYLONG_INTERNALS 0
287 #ifndef CYTHON_AVOID_BORROWED_REFS
288 #define CYTHON_AVOID_BORROWED_REFS 0
290 #ifndef CYTHON_ASSUME_SAFE_MACROS
291 #define CYTHON_ASSUME_SAFE_MACROS 1
293 #ifndef CYTHON_UNPACK_METHODS
294 #define CYTHON_UNPACK_METHODS 1
296 #undef CYTHON_FAST_THREAD_STATE
297 #define CYTHON_FAST_THREAD_STATE 0
298 #undef CYTHON_FAST_PYCALL
299 #define CYTHON_FAST_PYCALL 0
300 #undef CYTHON_PEP489_MULTI_PHASE_INIT
301 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
302 #undef CYTHON_USE_TP_FINALIZE
303 #define CYTHON_USE_TP_FINALIZE 0
304 #undef CYTHON_USE_DICT_VERSIONS
305 #define CYTHON_USE_DICT_VERSIONS 0
306 #undef CYTHON_USE_EXC_INFO_STACK
307 #define CYTHON_USE_EXC_INFO_STACK 0
308 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
309 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
311 #elif defined(PY_NOGIL)
312 #define CYTHON_COMPILING_IN_PYPY 0
313 #define CYTHON_COMPILING_IN_PYSTON 0
314 #define CYTHON_COMPILING_IN_CPYTHON 0
315 #define CYTHON_COMPILING_IN_NOGIL 1
316 #ifndef CYTHON_USE_TYPE_SLOTS
317 #define CYTHON_USE_TYPE_SLOTS 1
319 #undef CYTHON_USE_PYTYPE_LOOKUP
320 #define CYTHON_USE_PYTYPE_LOOKUP 0
321 #ifndef CYTHON_USE_ASYNC_SLOTS
322 #define CYTHON_USE_ASYNC_SLOTS 1
324 #undef CYTHON_USE_PYLIST_INTERNALS
325 #define CYTHON_USE_PYLIST_INTERNALS 0
326 #ifndef CYTHON_USE_UNICODE_INTERNALS
327 #define CYTHON_USE_UNICODE_INTERNALS 1
329 #undef CYTHON_USE_UNICODE_WRITER
330 #define CYTHON_USE_UNICODE_WRITER 0
331 #undef CYTHON_USE_PYLONG_INTERNALS
332 #define CYTHON_USE_PYLONG_INTERNALS 0
333 #ifndef CYTHON_AVOID_BORROWED_REFS
334 #define CYTHON_AVOID_BORROWED_REFS 0
336 #ifndef CYTHON_ASSUME_SAFE_MACROS
337 #define CYTHON_ASSUME_SAFE_MACROS 1
339 #ifndef CYTHON_UNPACK_METHODS
340 #define CYTHON_UNPACK_METHODS 1
342 #undef CYTHON_FAST_THREAD_STATE
343 #define CYTHON_FAST_THREAD_STATE 0
344 #undef CYTHON_FAST_PYCALL
345 #define CYTHON_FAST_PYCALL 0
346 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
347 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
349 #ifndef CYTHON_USE_TP_FINALIZE
350 #define CYTHON_USE_TP_FINALIZE 1
352 #undef CYTHON_USE_DICT_VERSIONS
353 #define CYTHON_USE_DICT_VERSIONS 0
354 #undef CYTHON_USE_EXC_INFO_STACK
355 #define CYTHON_USE_EXC_INFO_STACK 0
357 #define CYTHON_COMPILING_IN_PYPY 0
358 #define CYTHON_COMPILING_IN_PYSTON 0
359 #define CYTHON_COMPILING_IN_CPYTHON 1
360 #define CYTHON_COMPILING_IN_NOGIL 0
361 #ifndef CYTHON_USE_TYPE_SLOTS
362 #define CYTHON_USE_TYPE_SLOTS 1
364 #if PY_VERSION_HEX < 0x02070000
365 #undef CYTHON_USE_PYTYPE_LOOKUP
366 #define CYTHON_USE_PYTYPE_LOOKUP 0
367 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
368 #define CYTHON_USE_PYTYPE_LOOKUP 1
370 #if PY_MAJOR_VERSION < 3
371 #undef CYTHON_USE_ASYNC_SLOTS
372 #define CYTHON_USE_ASYNC_SLOTS 0
373 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
374 #define CYTHON_USE_ASYNC_SLOTS 1
376 #if PY_VERSION_HEX < 0x02070000
377 #undef CYTHON_USE_PYLONG_INTERNALS
378 #define CYTHON_USE_PYLONG_INTERNALS 0
379 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
380 #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
382 #ifndef CYTHON_USE_PYLIST_INTERNALS
383 #define CYTHON_USE_PYLIST_INTERNALS 1
385 #ifndef CYTHON_USE_UNICODE_INTERNALS
386 #define CYTHON_USE_UNICODE_INTERNALS 1
388 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
389 #undef CYTHON_USE_UNICODE_WRITER
390 #define CYTHON_USE_UNICODE_WRITER 0
391 #elif !defined(CYTHON_USE_UNICODE_WRITER)
392 #define CYTHON_USE_UNICODE_WRITER 1
394 #ifndef CYTHON_AVOID_BORROWED_REFS
395 #define CYTHON_AVOID_BORROWED_REFS 0
397 #ifndef CYTHON_ASSUME_SAFE_MACROS
398 #define CYTHON_ASSUME_SAFE_MACROS 1
400 #ifndef CYTHON_UNPACK_METHODS
401 #define CYTHON_UNPACK_METHODS 1
403 #if PY_VERSION_HEX >= 0x030B00A4
404 #undef CYTHON_FAST_THREAD_STATE
405 #define CYTHON_FAST_THREAD_STATE 0
406 #elif !defined(CYTHON_FAST_THREAD_STATE)
407 #define CYTHON_FAST_THREAD_STATE 1
409 #ifndef CYTHON_FAST_PYCALL
410 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
412 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
413 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
415 #ifndef CYTHON_USE_TP_FINALIZE
416 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
418 #ifndef CYTHON_USE_DICT_VERSIONS
419 #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
421 #if PY_VERSION_HEX >= 0x030B00A4
422 #undef CYTHON_USE_EXC_INFO_STACK
423 #define CYTHON_USE_EXC_INFO_STACK 0
424 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
425 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
427 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
428 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
431 #if !defined(CYTHON_FAST_PYCCALL)
432 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
434 #if CYTHON_USE_PYLONG_INTERNALS
435 #if PY_MAJOR_VERSION < 3
436 #include "longintrepr.h"
442 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
445 #ifndef __has_attribute
446 #define __has_attribute(x) 0
448 #ifndef __has_cpp_attribute
449 #define __has_cpp_attribute(x) 0
451 #ifndef CYTHON_RESTRICT
452 #if defined(__GNUC__)
453 #define CYTHON_RESTRICT __restrict__
454 #elif defined(_MSC_VER) && _MSC_VER >= 1400
455 #define CYTHON_RESTRICT __restrict
456 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
457 #define CYTHON_RESTRICT restrict
459 #define CYTHON_RESTRICT
462 #ifndef CYTHON_UNUSED
463 # if defined(__GNUC__)
464 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
465 # define CYTHON_UNUSED __attribute__ ((__unused__))
467 # define CYTHON_UNUSED
469 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
470 # define CYTHON_UNUSED __attribute__ ((__unused__))
472 # define CYTHON_UNUSED
475 #ifndef CYTHON_MAYBE_UNUSED_VAR
476 # if defined(__cplusplus)
477 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
479 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
482 #ifndef CYTHON_NCP_UNUSED
483 # if CYTHON_COMPILING_IN_CPYTHON
484 # define CYTHON_NCP_UNUSED
486 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
489 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
491 #ifndef _MSC_STDINT_H_
493 typedef unsigned char uint8_t;
494 typedef unsigned int uint32_t;
496 typedef unsigned __int8 uint8_t;
497 typedef unsigned __int32 uint32_t;
503 #ifndef CYTHON_FALLTHROUGH
504 #if defined(__cplusplus) && __cplusplus >= 201103L
505 #if __has_cpp_attribute(fallthrough)
506 #define CYTHON_FALLTHROUGH [[fallthrough]]
507 #elif __has_cpp_attribute(clang::fallthrough)
508 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
509 #elif __has_cpp_attribute(gnu::fallthrough)
510 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
513 #ifndef CYTHON_FALLTHROUGH
514 #if __has_attribute(fallthrough)
515 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
517 #define CYTHON_FALLTHROUGH
520 #if defined(__clang__ ) && defined(__apple_build_version__)
521 #if __apple_build_version__ < 7000000
522 #undef CYTHON_FALLTHROUGH
523 #define CYTHON_FALLTHROUGH
529 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
531 #ifndef CYTHON_INLINE
532 #if defined(__clang__)
533 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
535 #define CYTHON_INLINE inline
539 void __Pyx_call_destructor(T& x) {
543 class __Pyx_FakeReference {
545 __Pyx_FakeReference() : ptr(NULL) { }
546 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
547 T *operator->() {
return ptr; }
548 T *operator&() {
return ptr; }
549 operator T&() {
return *ptr; }
550 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
551 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
556 #define __PYX_BUILD_PY_SSIZE_T "n"
557 #define CYTHON_FORMAT_SSIZE_T "z"
558 #if PY_MAJOR_VERSION < 3
559 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
560 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
561 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
562 #define __Pyx_DefaultClassType PyClass_Type
564 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
565 #define __Pyx_DefaultClassType PyType_Type
566 #if PY_VERSION_HEX >= 0x030B00A1
567 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
568 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
569 PyObject *fv, PyObject *cell, PyObject* fn,
570 PyObject *name,
int fline, PyObject *lnos) {
571 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
572 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
573 const char *fn_cstr=NULL;
574 const char *name_cstr=NULL;
575 PyCodeObject* co=NULL;
576 PyObject *type, *value, *traceback;
577 PyErr_Fetch(&type, &value, &traceback);
578 if (!(kwds=PyDict_New()))
goto end;
579 if (!(argcount=PyLong_FromLong(a)))
goto end;
580 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
581 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
582 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
583 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
584 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
585 if (!(nlocals=PyLong_FromLong(l)))
goto end;
586 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
587 if (!(stacksize=PyLong_FromLong(s)))
goto end;
588 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
589 if (!(flags=PyLong_FromLong(f)))
goto end;
590 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
591 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
592 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
593 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
594 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
595 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
596 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
597 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
598 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
599 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
600 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
601 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
602 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
603 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
604 Py_XDECREF((PyObject*)co);
605 co = (PyCodeObject*)call_result;
609 Py_XDECREF((PyObject*)co);
614 Py_XDECREF(argcount);
615 Py_XDECREF(posonlyargcount);
616 Py_XDECREF(kwonlyargcount);
618 Py_XDECREF(stacksize);
620 Py_XDECREF(call_result);
623 PyErr_Restore(type, value, traceback);
628 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
629 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
631 #define __Pyx_DefaultClassType PyType_Type
633 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
634 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
636 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
638 #ifndef Py_TPFLAGS_CHECKTYPES
639 #define Py_TPFLAGS_CHECKTYPES 0
641 #ifndef Py_TPFLAGS_HAVE_INDEX
642 #define Py_TPFLAGS_HAVE_INDEX 0
644 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
645 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
647 #ifndef Py_TPFLAGS_HAVE_FINALIZE
648 #define Py_TPFLAGS_HAVE_FINALIZE 0
650 #ifndef METH_STACKLESS
651 #define METH_STACKLESS 0
653 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
654 #ifndef METH_FASTCALL
655 #define METH_FASTCALL 0x80
657 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
658 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
659 Py_ssize_t nargs, PyObject *kwnames);
661 #define __Pyx_PyCFunctionFast _PyCFunctionFast
662 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
664 #if CYTHON_FAST_PYCCALL
665 #define __Pyx_PyFastCFunction_Check(func)\
666 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
668 #define __Pyx_PyFastCFunction_Check(func) 0
670 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
671 #define PyObject_Malloc(s) PyMem_Malloc(s)
672 #define PyObject_Free(p) PyMem_Free(p)
673 #define PyObject_Realloc(p) PyMem_Realloc(p)
675 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
676 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
677 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
678 #define PyMem_RawFree(p) PyMem_Free(p)
680 #if CYTHON_COMPILING_IN_PYSTON
681 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
682 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
684 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
685 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
687 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
688 #define __Pyx_PyThreadState_Current PyThreadState_GET()
689 #elif PY_VERSION_HEX >= 0x03060000
690 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
691 #elif PY_VERSION_HEX >= 0x03000000
692 #define __Pyx_PyThreadState_Current PyThreadState_GET()
694 #define __Pyx_PyThreadState_Current _PyThreadState_Current
696 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
697 #include "pythread.h"
698 #define Py_tss_NEEDS_INIT 0
699 typedef int Py_tss_t;
700 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
701 *key = PyThread_create_key();
704 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
705 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
706 *key = Py_tss_NEEDS_INIT;
709 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
712 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
713 return *key != Py_tss_NEEDS_INIT;
715 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
716 PyThread_delete_key(*key);
717 *key = Py_tss_NEEDS_INIT;
719 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
720 return PyThread_set_key_value(*key, value);
722 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
723 return PyThread_get_key_value(*key);
726 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
727 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
729 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
731 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
732 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
733 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
735 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
736 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
738 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
739 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
741 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
743 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
744 #define CYTHON_PEP393_ENABLED 1
745 #if PY_VERSION_HEX >= 0x030C0000
746 #define __Pyx_PyUnicode_READY(op) (0)
748 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
749 0 : _PyUnicode_Ready((PyObject *)(op)))
751 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
752 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
753 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
754 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
755 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
756 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
757 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
758 #if PY_VERSION_HEX >= 0x030C0000
759 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
761 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
762 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
764 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
768 #define CYTHON_PEP393_ENABLED 0
769 #define PyUnicode_1BYTE_KIND 1
770 #define PyUnicode_2BYTE_KIND 2
771 #define PyUnicode_4BYTE_KIND 4
772 #define __Pyx_PyUnicode_READY(op) (0)
773 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
774 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
775 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
776 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
777 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
778 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
779 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
780 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
782 #if CYTHON_COMPILING_IN_PYPY
783 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
784 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
786 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
787 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
788 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
790 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
791 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
793 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
794 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
796 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
797 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
799 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
800 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
801 #if PY_MAJOR_VERSION >= 3
802 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
804 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
806 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
807 #define PyObject_ASCII(o) PyObject_Repr(o)
809 #if PY_MAJOR_VERSION >= 3
810 #define PyBaseString_Type PyUnicode_Type
811 #define PyStringObject PyUnicodeObject
812 #define PyString_Type PyUnicode_Type
813 #define PyString_Check PyUnicode_Check
814 #define PyString_CheckExact PyUnicode_CheckExact
815 #ifndef PyObject_Unicode
816 #define PyObject_Unicode PyObject_Str
819 #if PY_MAJOR_VERSION >= 3
820 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
821 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
823 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
824 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
826 #ifndef PySet_CheckExact
827 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
829 #if PY_VERSION_HEX >= 0x030900A4
830 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
831 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
833 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
834 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
836 #if CYTHON_ASSUME_SAFE_MACROS
837 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
839 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
841 #if PY_MAJOR_VERSION >= 3
842 #define PyIntObject PyLongObject
843 #define PyInt_Type PyLong_Type
844 #define PyInt_Check(op) PyLong_Check(op)
845 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
846 #define PyInt_FromString PyLong_FromString
847 #define PyInt_FromUnicode PyLong_FromUnicode
848 #define PyInt_FromLong PyLong_FromLong
849 #define PyInt_FromSize_t PyLong_FromSize_t
850 #define PyInt_FromSsize_t PyLong_FromSsize_t
851 #define PyInt_AsLong PyLong_AsLong
852 #define PyInt_AS_LONG PyLong_AS_LONG
853 #define PyInt_AsSsize_t PyLong_AsSsize_t
854 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
855 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
856 #define PyNumber_Int PyNumber_Long
858 #if PY_MAJOR_VERSION >= 3
859 #define PyBoolObject PyLongObject
861 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
862 #ifndef PyUnicode_InternFromString
863 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
866 #if PY_VERSION_HEX < 0x030200A4
867 typedef long Py_hash_t;
868 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
869 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
871 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
872 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
874 #if PY_MAJOR_VERSION >= 3
875 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
877 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
879 #if CYTHON_USE_ASYNC_SLOTS
880 #if PY_VERSION_HEX >= 0x030500B1
881 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
882 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
884 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
887 #define __Pyx_PyType_AsAsync(obj) NULL
889 #ifndef __Pyx_PyAsyncMethodsStruct
894 } __Pyx_PyAsyncMethodsStruct;
897 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
898 #if !defined(_USE_MATH_DEFINES)
899 #define _USE_MATH_DEFINES
904 #define __PYX_NAN() ((float) NAN)
906 static CYTHON_INLINE
float __PYX_NAN() {
908 memset(&value, 0xFF,
sizeof(value));
912 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
913 #define __Pyx_truncl trunc
915 #define __Pyx_truncl truncl
918 #define __PYX_MARK_ERR_POS(f_index, lineno) \
919 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
920 #define __PYX_ERR(f_index, lineno, Ln_error) \
921 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
923 #ifndef __PYX_EXTERN_C
925 #define __PYX_EXTERN_C extern "C"
927 #define __PYX_EXTERN_C extern
931 #define __PYX_HAVE__imate___c_linear_operator__py_c_matrix
932 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_matrix
943 #include "pythread.h"
952 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
953 #define CYTHON_WITHOUT_ASSERTIONS
956 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
957 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
959 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
960 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
961 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
962 #define __PYX_DEFAULT_STRING_ENCODING ""
963 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
964 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
965 #define __Pyx_uchar_cast(c) ((unsigned char)c)
966 #define __Pyx_long_cast(x) ((long)x)
967 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
968 (sizeof(type) < sizeof(Py_ssize_t)) ||\
969 (sizeof(type) > sizeof(Py_ssize_t) &&\
970 likely(v < (type)PY_SSIZE_T_MAX ||\
971 v == (type)PY_SSIZE_T_MAX) &&\
972 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
973 v == (type)PY_SSIZE_T_MIN))) ||\
974 (sizeof(type) == sizeof(Py_ssize_t) &&\
975 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
976 v == (type)PY_SSIZE_T_MAX))) )
977 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
978 return (
size_t) i < (size_t) limit;
980 #if defined (__cplusplus) && __cplusplus >= 201103L
982 #define __Pyx_sst_abs(value) std::abs(value)
983 #elif SIZEOF_INT >= SIZEOF_SIZE_T
984 #define __Pyx_sst_abs(value) abs(value)
985 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
986 #define __Pyx_sst_abs(value) labs(value)
987 #elif defined (_MSC_VER)
988 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
989 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
990 #define __Pyx_sst_abs(value) llabs(value)
991 #elif defined (__GNUC__)
992 #define __Pyx_sst_abs(value) __builtin_llabs(value)
994 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
996 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
997 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
998 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
999 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1000 #define __Pyx_PyBytes_FromString PyBytes_FromString
1001 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1002 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1003 #if PY_MAJOR_VERSION < 3
1004 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1005 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1007 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1008 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1010 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1011 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1012 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1013 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1014 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1015 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1016 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
1017 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
1018 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
1019 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1020 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1021 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1022 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1023 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1024 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1025 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1026 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
1027 const Py_UNICODE *u_end = u;
1029 return (
size_t)(u_end - u - 1);
1031 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1032 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1033 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1034 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1035 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1036 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1037 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1038 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1039 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1040 #define __Pyx_PySequence_Tuple(obj)\
1041 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1042 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1043 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
1044 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1045 #if CYTHON_ASSUME_SAFE_MACROS
1046 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1048 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1050 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1051 #if PY_MAJOR_VERSION >= 3
1052 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1054 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1056 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1057 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1058 static int __Pyx_sys_getdefaultencoding_not_ascii;
1059 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1061 PyObject* default_encoding = NULL;
1062 PyObject* ascii_chars_u = NULL;
1063 PyObject* ascii_chars_b = NULL;
1064 const char* default_encoding_c;
1065 sys = PyImport_ImportModule(
"sys");
1067 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1069 if (!default_encoding)
goto bad;
1070 default_encoding_c = PyBytes_AsString(default_encoding);
1071 if (!default_encoding_c)
goto bad;
1072 if (strcmp(default_encoding_c,
"ascii") == 0) {
1073 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1075 char ascii_chars[128];
1077 for (c = 0; c < 128; c++) {
1080 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1081 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1082 if (!ascii_chars_u)
goto bad;
1083 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1084 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1087 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1088 default_encoding_c);
1091 Py_DECREF(ascii_chars_u);
1092 Py_DECREF(ascii_chars_b);
1094 Py_DECREF(default_encoding);
1097 Py_XDECREF(default_encoding);
1098 Py_XDECREF(ascii_chars_u);
1099 Py_XDECREF(ascii_chars_b);
1103 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1104 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1106 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1107 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1108 static char* __PYX_DEFAULT_STRING_ENCODING;
1109 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1111 PyObject* default_encoding = NULL;
1112 char* default_encoding_c;
1113 sys = PyImport_ImportModule(
"sys");
1115 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1117 if (!default_encoding)
goto bad;
1118 default_encoding_c = PyBytes_AsString(default_encoding);
1119 if (!default_encoding_c)
goto bad;
1120 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1121 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1122 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1123 Py_DECREF(default_encoding);
1126 Py_XDECREF(default_encoding);
1134 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1135 #define likely(x) __builtin_expect(!!(x), 1)
1136 #define unlikely(x) __builtin_expect(!!(x), 0)
1138 #define likely(x) (x)
1139 #define unlikely(x) (x)
1141 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1143 static PyObject *__pyx_m = NULL;
1144 static PyObject *__pyx_d;
1145 static PyObject *__pyx_b;
1146 static PyObject *__pyx_cython_runtime = NULL;
1147 static PyObject *__pyx_empty_tuple;
1148 static PyObject *__pyx_empty_bytes;
1149 static PyObject *__pyx_empty_unicode;
1150 static int __pyx_lineno;
1151 static int __pyx_clineno = 0;
1152 static const char * __pyx_cfilenm= __FILE__;
1153 static const char *__pyx_filename;
1156 static const char *__pyx_f[] = {
1157 "imate/_c_linear_operator/py_c_matrix.pyx",
1161 struct __pyx_memoryview_obj;
1163 struct __pyx_memoryview_obj *memview;
1165 Py_ssize_t shape[8];
1166 Py_ssize_t strides[8];
1167 Py_ssize_t suboffsets[8];
1168 } __Pyx_memviewslice;
1169 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1172 #include <pythread.h>
1173 #ifndef CYTHON_ATOMICS
1174 #define CYTHON_ATOMICS 1
1176 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1177 #define __pyx_atomic_int_type int
1178 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1179 (__GNUC_MINOR__ > 1 ||\
1180 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1181 #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1182 #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1183 #ifdef __PYX_DEBUG_ATOMICS
1184 #warning "Using GNU atomics"
1186 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1188 #undef __pyx_atomic_int_type
1189 #define __pyx_atomic_int_type long
1190 #pragma intrinsic (_InterlockedExchangeAdd)
1191 #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1192 #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1193 #ifdef __PYX_DEBUG_ATOMICS
1194 #pragma message ("Using MSVC atomics")
1197 #undef CYTHON_ATOMICS
1198 #define CYTHON_ATOMICS 0
1199 #ifdef __PYX_DEBUG_ATOMICS
1200 #warning "Not using atomics"
1203 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1205 #define __pyx_add_acquisition_count(memview)\
1206 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1207 #define __pyx_sub_acquisition_count(memview)\
1208 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1210 #define __pyx_add_acquisition_count(memview)\
1211 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1212 #define __pyx_sub_acquisition_count(memview)\
1213 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1217 #ifndef __PYX_FORCE_INIT_THREADS
1218 #define __PYX_FORCE_INIT_THREADS 0
1222 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1223 #define __Pyx_PyGILState_Release PyGILState_Release
1224 #define __Pyx_FastGIL_Remember()
1225 #define __Pyx_FastGIL_Forget()
1226 #define __Pyx_FastGilFuncInit()
1229 #define IS_UNSIGNED(type) (((type) -1) > 0)
1230 struct __Pyx_StructField_;
1231 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1234 struct __Pyx_StructField_* fields;
1236 size_t arraysize[8];
1242 typedef struct __Pyx_StructField_ {
1243 __Pyx_TypeInfo* type;
1246 } __Pyx_StructField;
1248 __Pyx_StructField* field;
1249 size_t parent_offset;
1250 } __Pyx_BufFmt_StackElem;
1252 __Pyx_StructField root;
1253 __Pyx_BufFmt_StackElem* head;
1255 size_t new_count, enc_count;
1256 size_t struct_alignment;
1261 char is_valid_array;
1262 } __Pyx_BufFmt_Context;
1272 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1281 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1290 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1299 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1308 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1317 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1320 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1321 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1322 struct __pyx_array_obj;
1323 struct __pyx_MemviewEnum_obj;
1324 struct __pyx_memoryview_obj;
1325 struct __pyx_memoryviewslice_obj;
1334 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1343 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1352 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1361 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1370 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1372 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1376 char *data_type_name;
1377 char *long_index_type_name;
1378 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1379 PyObject *parameters;
1390 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1391 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1393 PyObject *A_indices_copy;
1394 PyObject *A_index_pointer_copy;
1405 struct __pyx_array_obj {
1407 struct __pyx_vtabstruct_array *__pyx_vtab;
1413 Py_ssize_t *_strides;
1414 Py_ssize_t itemsize;
1417 void (*callback_free_data)(
void *);
1419 int dtype_is_object;
1430 struct __pyx_MemviewEnum_obj {
1443 struct __pyx_memoryview_obj {
1445 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1448 PyObject *_array_interface;
1449 PyThread_type_lock lock;
1450 __pyx_atomic_int acquisition_count[2];
1451 __pyx_atomic_int *acquisition_count_aligned_p;
1454 int dtype_is_object;
1455 __Pyx_TypeInfo *typeinfo;
1466 struct __pyx_memoryviewslice_obj {
1467 struct __pyx_memoryview_obj __pyx_base;
1468 __Pyx_memviewslice from_slice;
1469 PyObject *from_object;
1470 PyObject *(*to_object_func)(
char *);
1471 int (*to_dtype_func)(
char *, PyObject *);
1484 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1485 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1486 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1487 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1488 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1489 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1490 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1491 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1493 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1504 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1505 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1507 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1518 struct __pyx_vtabstruct_array {
1519 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1521 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1532 struct __pyx_vtabstruct_memoryview {
1533 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1534 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1535 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1536 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1537 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1538 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1539 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1541 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1552 struct __pyx_vtabstruct__memoryviewslice {
1553 struct __pyx_vtabstruct_memoryview __pyx_base;
1555 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1559 #ifndef CYTHON_REFNANNY
1560 #define CYTHON_REFNANNY 0
1564 void (*INCREF)(
void*, PyObject*, int);
1565 void (*DECREF)(
void*, PyObject*, int);
1566 void (*GOTREF)(
void*, PyObject*, int);
1567 void (*GIVEREF)(
void*, PyObject*, int);
1568 void* (*SetupContext)(
const char*, int,
const char*);
1569 void (*FinishContext)(
void**);
1570 } __Pyx_RefNannyAPIStruct;
1571 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1572 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1573 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1575 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1577 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1578 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1579 PyGILState_Release(__pyx_gilstate_save);\
1581 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1584 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1585 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1587 #define __Pyx_RefNannyFinishContext()\
1588 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1589 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1590 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1591 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1592 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1593 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1594 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1595 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1596 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1598 #define __Pyx_RefNannyDeclarations
1599 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1600 #define __Pyx_RefNannyFinishContext()
1601 #define __Pyx_INCREF(r) Py_INCREF(r)
1602 #define __Pyx_DECREF(r) Py_DECREF(r)
1603 #define __Pyx_GOTREF(r)
1604 #define __Pyx_GIVEREF(r)
1605 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1606 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1607 #define __Pyx_XGOTREF(r)
1608 #define __Pyx_XGIVEREF(r)
1610 #define __Pyx_XDECREF_SET(r, v) do {\
1611 PyObject *tmp = (PyObject *) r;\
1612 r = v; __Pyx_XDECREF(tmp);\
1614 #define __Pyx_DECREF_SET(r, v) do {\
1615 PyObject *tmp = (PyObject *) r;\
1616 r = v; __Pyx_DECREF(tmp);\
1618 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1619 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1622 #if CYTHON_USE_TYPE_SLOTS
1623 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1625 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1629 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1632 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1635 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1636 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1637 const char* function_name);
1640 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1641 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1644 #if CYTHON_FAST_THREAD_STATE
1645 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1646 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1647 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1649 #define __Pyx_PyThreadState_declare
1650 #define __Pyx_PyThreadState_assign
1651 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1655 #if CYTHON_FAST_THREAD_STATE
1656 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1657 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1658 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1659 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1660 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1661 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1662 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1663 #if CYTHON_COMPILING_IN_CPYTHON
1664 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1666 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1669 #define __Pyx_PyErr_Clear() PyErr_Clear()
1670 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1671 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1672 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1673 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1674 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1675 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1676 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1680 #ifndef CYTHON_PROFILE
1681 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1682 #define CYTHON_PROFILE 0
1684 #define CYTHON_PROFILE 1
1687 #ifndef CYTHON_TRACE_NOGIL
1688 #define CYTHON_TRACE_NOGIL 0
1690 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1691 #define CYTHON_TRACE 1
1694 #ifndef CYTHON_TRACE
1695 #define CYTHON_TRACE 0
1698 #undef CYTHON_PROFILE_REUSE_FRAME
1700 #ifndef CYTHON_PROFILE_REUSE_FRAME
1701 #define CYTHON_PROFILE_REUSE_FRAME 0
1703 #if CYTHON_PROFILE || CYTHON_TRACE
1704 #include "compile.h"
1705 #include "frameobject.h"
1706 #include "traceback.h"
1707 #if PY_VERSION_HEX >= 0x030b00a6
1708 #ifndef Py_BUILD_CORE
1709 #define Py_BUILD_CORE 1
1711 #include "internal/pycore_frame.h"
1713 #if CYTHON_PROFILE_REUSE_FRAME
1714 #define CYTHON_FRAME_MODIFIER static
1715 #define CYTHON_FRAME_DEL(frame)
1717 #define CYTHON_FRAME_MODIFIER
1718 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1720 #define __Pyx_TraceDeclarations\
1721 static PyCodeObject *__pyx_frame_code = NULL;\
1722 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1723 int __Pyx_use_tracing = 0;
1724 #define __Pyx_TraceFrameInit(codeobj)\
1725 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1726 #if PY_VERSION_HEX >= 0x030b00a2
1727 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1728 (unlikely((tstate)->cframe->use_tracing) &&\
1729 (!(check_tracing) || !(tstate)->tracing) &&\
1730 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1731 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1732 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1733 #elif PY_VERSION_HEX >= 0x030a00b1
1734 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1735 (unlikely((tstate)->cframe->use_tracing) &&\
1736 (!(check_tracing) || !(tstate)->tracing) &&\
1737 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1738 #define __Pyx_EnterTracing(tstate)\
1739 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1740 #define __Pyx_LeaveTracing(tstate)\
1743 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1744 || tstate->c_profilefunc != NULL);\
1747 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1748 (unlikely((tstate)->use_tracing) &&\
1749 (!(check_tracing) || !(tstate)->tracing) &&\
1750 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1751 #define __Pyx_EnterTracing(tstate)\
1752 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1753 #define __Pyx_LeaveTracing(tstate)\
1756 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1757 || tstate->c_profilefunc != NULL);\
1761 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1763 if (CYTHON_TRACE_NOGIL) {\
1764 PyThreadState *tstate;\
1765 PyGILState_STATE state = PyGILState_Ensure();\
1766 tstate = __Pyx_PyThreadState_Current;\
1767 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1768 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1770 PyGILState_Release(state);\
1771 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1774 PyThreadState* tstate = PyThreadState_GET();\
1775 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1776 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1777 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1781 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1782 { PyThreadState* tstate = PyThreadState_GET();\
1783 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1784 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1785 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1789 #define __Pyx_TraceException()\
1790 if (likely(!__Pyx_use_tracing)); else {\
1791 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1792 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1793 __Pyx_EnterTracing(tstate);\
1794 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1796 if (CYTHON_TRACE && tstate->c_tracefunc)\
1797 tstate->c_tracefunc(\
1798 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1799 tstate->c_profilefunc(\
1800 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1801 Py_DECREF(exc_info);\
1803 __Pyx_LeaveTracing(tstate);\
1806 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1807 PyObject *type, *value, *traceback;
1808 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1809 __Pyx_EnterTracing(tstate);
1810 if (CYTHON_TRACE && tstate->c_tracefunc)
1811 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1812 if (tstate->c_profilefunc)
1813 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1814 CYTHON_FRAME_DEL(frame);
1815 __Pyx_LeaveTracing(tstate);
1816 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1819 #define __Pyx_TraceReturn(result, nogil)\
1820 if (likely(!__Pyx_use_tracing)); else {\
1822 if (CYTHON_TRACE_NOGIL) {\
1823 PyThreadState *tstate;\
1824 PyGILState_STATE state = PyGILState_Ensure();\
1825 tstate = __Pyx_PyThreadState_Current;\
1826 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1827 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1829 PyGILState_Release(state);\
1832 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1833 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1834 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1839 #define __Pyx_TraceReturn(result, nogil)\
1840 if (likely(!__Pyx_use_tracing)); else {\
1841 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1842 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1843 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1847 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1848 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1850 #define __Pyx_TraceDeclarations
1851 #define __Pyx_TraceFrameInit(codeobj)
1852 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1853 #define __Pyx_TraceException()
1854 #define __Pyx_TraceReturn(result, nogil)
1857 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1859 PyObject *type, *value, *traceback;
1860 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1861 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1862 __Pyx_EnterTracing(tstate);
1863 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1864 __Pyx_LeaveTracing(tstate);
1866 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1870 Py_XDECREF(traceback);
1875 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1876 if (likely(!__Pyx_use_tracing)); else {\
1878 if (CYTHON_TRACE_NOGIL) {\
1880 PyThreadState *tstate;\
1881 PyGILState_STATE state = PyGILState_Ensure();\
1882 tstate = __Pyx_PyThreadState_Current;\
1883 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1884 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1886 PyGILState_Release(state);\
1887 if (unlikely(ret)) goto_error;\
1890 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1891 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1892 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1893 if (unlikely(ret)) goto_error;\
1898 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1899 if (likely(!__Pyx_use_tracing)); else {\
1900 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1901 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1902 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1903 if (unlikely(ret)) goto_error;\
1908 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1912 #if CYTHON_COMPILING_IN_CPYTHON
1913 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1915 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1919 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1922 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1928 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1931 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1932 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1933 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1934 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1935 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1936 (cache_var) = (value);
1937 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1938 static PY_UINT64_T __pyx_dict_version = 0;\
1939 static PyObject *__pyx_dict_cached_value = NULL;\
1940 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1941 (VAR) = __pyx_dict_cached_value;\
1943 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1944 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1947 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1948 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1949 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1951 #define __PYX_GET_DICT_VERSION(dict) (0)
1952 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1953 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1957 #if CYTHON_USE_DICT_VERSIONS
1958 #define __Pyx_GetModuleGlobalName(var, name) do {\
1959 static PY_UINT64_T __pyx_dict_version = 0;\
1960 static PyObject *__pyx_dict_cached_value = NULL;\
1961 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1962 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1963 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1965 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1966 PY_UINT64_T __pyx_dict_version;\
1967 PyObject *__pyx_dict_cached_value;\
1968 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1970 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1972 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1973 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1974 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1978 #if CYTHON_FAST_PYCCALL
1979 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1981 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1985 #if CYTHON_FAST_PYCALL
1986 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1987 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1988 #if 1 || PY_VERSION_HEX < 0x030600B1
1989 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1991 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1993 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1994 (sizeof(char [1 - 2*!(cond)]) - 1)
1995 #ifndef Py_MEMBER_SIZE
1996 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1998 #if CYTHON_FAST_PYCALL
1999 static size_t __pyx_pyframe_localsplus_offset = 0;
2000 #include "frameobject.h"
2001 #if PY_VERSION_HEX >= 0x030b00a6
2002 #ifndef Py_BUILD_CORE
2003 #define Py_BUILD_CORE 1
2005 #include "internal/pycore_frame.h"
2007 #define __Pxy_PyFrame_Initialize_Offsets()\
2008 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2009 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2010 #define __Pyx_PyFrame_GetLocalsplus(frame)\
2011 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2016 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
2019 #if CYTHON_COMPILING_IN_CPYTHON
2020 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2024 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2027 #if CYTHON_COMPILING_IN_CPYTHON
2028 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2030 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2034 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2035 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2036 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2037 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2038 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2039 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2040 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2041 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2042 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2043 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2044 int wraparound,
int boundscheck);
2045 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2046 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2047 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2048 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2049 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2050 int wraparound,
int boundscheck);
2051 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2052 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2053 int is_list,
int wraparound,
int boundscheck);
2056 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2057 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2058 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2059 (likely(PyDict_CheckExact(obj)) ?\
2060 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2062 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2063 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2067 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2068 #define __Pyx_MEMVIEW_DIRECT 1
2069 #define __Pyx_MEMVIEW_PTR 2
2070 #define __Pyx_MEMVIEW_FULL 4
2071 #define __Pyx_MEMVIEW_CONTIG 8
2072 #define __Pyx_MEMVIEW_STRIDED 16
2073 #define __Pyx_MEMVIEW_FOLLOW 32
2074 #define __Pyx_IS_C_CONTIG 1
2075 #define __Pyx_IS_F_CONTIG 2
2076 static int __Pyx_init_memviewslice(
2077 struct __pyx_memoryview_obj *memview,
2079 __Pyx_memviewslice *memviewslice,
2080 int memview_is_new_reference);
2081 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
2082 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2083 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
2084 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2085 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2086 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2087 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2088 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2089 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2090 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
2093 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2094 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2095 __Pyx__ArgTypeTest(obj, type, name, exact))
2096 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
2099 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
2102 #if PY_MAJOR_VERSION >= 3
2103 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2105 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2109 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2110 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2112 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2114 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
2115 int lineno,
const char *filename,
2116 int full_traceback,
int nogil);
2118 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
2120 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2123 #if CYTHON_USE_TYPE_SLOTS
2124 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2126 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2130 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
2132 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2134 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
2136 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2138 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
2140 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2144 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2145 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2146 const char* encoding,
const char* errors,
2147 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
2150 #if CYTHON_FAST_THREAD_STATE
2151 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2152 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2154 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2158 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2161 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2164 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2167 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2170 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2173 #if CYTHON_USE_EXC_INFO_STACK
2174 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2178 #if CYTHON_FAST_THREAD_STATE
2179 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2180 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2181 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2182 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2184 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2185 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2189 #if CYTHON_FAST_THREAD_STATE
2190 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2191 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2193 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2197 #if CYTHON_FAST_THREAD_STATE
2198 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2199 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2201 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2205 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2208 #if CYTHON_COMPILING_IN_CPYTHON
2209 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2210 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2211 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2212 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2214 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2215 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2216 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2218 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2220 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2222 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2223 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2224 PyListObject* L = (PyListObject*) list;
2225 Py_ssize_t len = Py_SIZE(list);
2226 if (likely(L->allocated > len)) {
2228 PyList_SET_ITEM(list, len, x);
2229 __Pyx_SET_SIZE(list, len + 1);
2232 return PyList_Append(list, x);
2235 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2239 #if !CYTHON_COMPILING_IN_PYPY
2240 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2242 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2243 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2247 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2248 #if CYTHON_COMPILING_IN_CPYTHON
2249 PyObject* none = _PyList_Extend((PyListObject*)L, v);
2250 if (unlikely(!none))
2255 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2260 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2261 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2262 PyListObject* L = (PyListObject*) list;
2263 Py_ssize_t len = Py_SIZE(list);
2264 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2266 PyList_SET_ITEM(list, len, x);
2267 __Pyx_SET_SIZE(list, len + 1);
2270 return PyList_Append(list, x);
2273 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2277 #define __Pyx_init_assertions_enabled()
2278 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2279 #define __pyx_assertions_enabled() (1)
2280 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2281 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2282 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2283 static int __pyx_assertions_enabled_flag;
2284 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2285 #undef __Pyx_init_assertions_enabled
2286 static void __Pyx_init_assertions_enabled(
void) {
2287 __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2290 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2294 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2297 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2298 int result = PySequence_Contains(seq, item);
2299 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2303 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2306 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2309 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2312 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse);
2315 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2318 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2319 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2321 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2325 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2326 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2328 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2332 #ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
2333 #define __PYX_HAVE_RT_ImportType_proto_0_29_36
2334 #if __STDC_VERSION__ >= 201112L
2335 #include <stdalign.h>
2337 #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
2338 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
2340 #define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
2342 enum __Pyx_ImportType_CheckSize_0_29_36 {
2343 __Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
2344 __Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
2345 __Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
2347 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
2351 static void* __Pyx_GetVtable(PyObject *dict);
2354 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2357 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2360 static int __Pyx_setup_reduce(PyObject* type_obj);
2363 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2366 #define __Pyx_CyFunction_USED 1
2367 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2368 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2369 #define __Pyx_CYFUNCTION_CCLASS 0x04
2370 #define __Pyx_CyFunction_GetClosure(f)\
2371 (((__pyx_CyFunctionObject *) (f))->func_closure)
2372 #define __Pyx_CyFunction_GetClassObj(f)\
2373 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2374 #define __Pyx_CyFunction_Defaults(type, f)\
2375 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2376 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2377 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2379 PyCFunctionObject func;
2380 #if PY_VERSION_HEX < 0x030500A0
2381 PyObject *func_weakreflist;
2383 PyObject *func_dict;
2384 PyObject *func_name;
2385 PyObject *func_qualname;
2387 PyObject *func_globals;
2388 PyObject *func_code;
2389 PyObject *func_closure;
2390 PyObject *func_classobj;
2392 int defaults_pyobjects;
2393 size_t defaults_size;
2395 PyObject *defaults_tuple;
2396 PyObject *defaults_kwdict;
2397 PyObject *(*defaults_getter)(PyObject *);
2398 PyObject *func_annotations;
2399 } __pyx_CyFunctionObject;
2400 static PyTypeObject *__pyx_CyFunctionType = 0;
2401 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2402 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2403 int flags, PyObject* qualname,
2405 PyObject *module, PyObject *globals,
2407 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2410 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2412 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2414 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2416 static int __pyx_CyFunction_init(
void);
2419 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2420 int flags, PyObject* qualname,
2422 PyObject *module, PyObject *globals,
2426 #ifdef CYTHON_CLINE_IN_TRACEBACK
2427 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2429 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2434 PyCodeObject* code_object;
2436 } __Pyx_CodeObjectCacheEntry;
2437 struct __Pyx_CodeObjectCache {
2440 __Pyx_CodeObjectCacheEntry* entries;
2442 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2443 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2444 static PyCodeObject *__pyx_find_code_object(
int code_line);
2445 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2448 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2449 int py_line,
const char *filename);
2451 #if PY_MAJOR_VERSION < 3
2452 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2453 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2455 #define __Pyx_GetBuffer PyObject_GetBuffer
2456 #define __Pyx_ReleaseBuffer PyBuffer_Release
2462 Py_ssize_t shape, strides, suboffsets;
2463 } __Pyx_Buf_DimInfo;
2469 __Pyx_Buffer *rcbuffer;
2471 __Pyx_Buf_DimInfo diminfo[8];
2472 } __Pyx_LocalBuf_ND;
2475 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2478 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2479 __Pyx_memviewslice *slice2,
2480 int ndim,
size_t itemsize);
2483 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2486 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2487 #define __Pyx_HAS_GCC_DIAGNOSTIC
2491 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2494 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2495 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2496 __Pyx_BufFmt_StackElem* stack,
2497 __Pyx_TypeInfo* type);
2500 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2503 static int __Pyx_ValidateAndInit_memviewslice(
2508 __Pyx_TypeInfo *dtype,
2509 __Pyx_BufFmt_StackElem stack[],
2510 __Pyx_memviewslice *memviewslice,
2511 PyObject *original_obj);
2514 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *,
int writable_flag);
2517 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *,
int writable_flag);
2520 #ifndef __Pyx_CppExn2PyErr
2523 #include <stdexcept>
2525 static void __Pyx_CppExn2PyErr() {
2527 if (PyErr_Occurred())
2531 }
catch (
const std::bad_alloc& exn) {
2532 PyErr_SetString(PyExc_MemoryError, exn.what());
2533 }
catch (
const std::bad_cast& exn) {
2534 PyErr_SetString(PyExc_TypeError, exn.what());
2535 }
catch (
const std::bad_typeid& exn) {
2536 PyErr_SetString(PyExc_TypeError, exn.what());
2537 }
catch (
const std::domain_error& exn) {
2538 PyErr_SetString(PyExc_ValueError, exn.what());
2539 }
catch (
const std::invalid_argument& exn) {
2540 PyErr_SetString(PyExc_ValueError, exn.what());
2541 }
catch (
const std::ios_base::failure& exn) {
2542 PyErr_SetString(PyExc_IOError, exn.what());
2543 }
catch (
const std::out_of_range& exn) {
2544 PyErr_SetString(PyExc_IndexError, exn.what());
2545 }
catch (
const std::overflow_error& exn) {
2546 PyErr_SetString(PyExc_OverflowError, exn.what());
2547 }
catch (
const std::range_error& exn) {
2548 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2549 }
catch (
const std::underflow_error& exn) {
2550 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2551 }
catch (
const std::exception& exn) {
2552 PyErr_SetString(PyExc_RuntimeError, exn.what());
2556 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
2562 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *,
int writable_flag);
2565 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *,
int writable_flag);
2568 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *,
int writable_flag);
2571 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *,
int writable_flag);
2574 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2577 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2580 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2583 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2586 static __Pyx_memviewslice
2587 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2588 const char *mode,
int ndim,
2589 size_t sizeof_dtype,
int contig_flag,
2590 int dtype_is_object);
2593 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2596 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2599 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2602 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2605 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2608 static int __Pyx_check_binary_version(
void);
2611 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2613 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2614 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2615 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2616 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2617 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2618 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2619 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2620 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2621 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2622 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2629 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2640 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2641 static PyTypeObject *__pyx_array_type = 0;
2642 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2643 static PyTypeObject *__pyx_memoryview_type = 0;
2644 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2645 static PyObject *
generic = 0;
2646 static PyObject *strided = 0;
2647 static PyObject *indirect = 0;
2648 static PyObject *contiguous = 0;
2649 static PyObject *indirect_contiguous = 0;
2650 static int __pyx_memoryview_thread_locks_used;
2651 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2652 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2653 static void *__pyx_align_pointer(
void *,
size_t);
2654 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2655 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2656 static PyObject *_unellipsify(PyObject *,
int);
2657 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2658 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2659 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2660 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2661 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2662 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2663 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2664 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2665 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2666 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2667 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2668 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2669 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2670 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2671 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2672 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2673 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2674 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2675 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2676 static int __pyx_memoryview_err(PyObject *,
char *);
2677 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2678 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2679 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2680 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2681 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2682 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2683 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2684 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2685 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2686 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2687 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2688 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2689 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_matrix"
2690 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix;
2691 int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix = 0;
2694 static PyObject *__pyx_builtin_ValueError;
2695 static PyObject *__pyx_builtin_TypeError;
2696 static PyObject *__pyx_builtin_MemoryError;
2697 static PyObject *__pyx_builtin_enumerate;
2698 static PyObject *__pyx_builtin_range;
2699 static PyObject *__pyx_builtin_Ellipsis;
2700 static PyObject *__pyx_builtin_id;
2701 static PyObject *__pyx_builtin_IndexError;
2702 static const char __pyx_k_A[] =
"A";
2703 static const char __pyx_k_O[] =
"O";
2704 static const char __pyx_k_c[] =
"c";
2705 static const char __pyx_k_id[] =
"id";
2706 static const char __pyx_k_new[] =
"__new__";
2707 static const char __pyx_k_obj[] =
"obj";
2708 static const char __pyx_k_base[] =
"base";
2709 static const char __pyx_k_copy[] =
"copy";
2710 static const char __pyx_k_data[] =
"data";
2711 static const char __pyx_k_dict[] =
"__dict__";
2712 static const char __pyx_k_main[] =
"__main__";
2713 static const char __pyx_k_mode[] =
"mode";
2714 static const char __pyx_k_name[] =
"name";
2715 static const char __pyx_k_ndim[] =
"ndim";
2716 static const char __pyx_k_pack[] =
"pack";
2717 static const char __pyx_k_self[] =
"self";
2718 static const char __pyx_k_size[] =
"size";
2719 static const char __pyx_k_step[] =
"step";
2720 static const char __pyx_k_stop[] =
"stop";
2721 static const char __pyx_k_test[] =
"__test__";
2722 static const char __pyx_k_ASCII[] =
"ASCII";
2723 static const char __pyx_k_class[] =
"__class__";
2724 static const char __pyx_k_dtype[] =
"dtype";
2725 static const char __pyx_k_error[] =
"error";
2726 static const char __pyx_k_flags[] =
"flags";
2727 static const char __pyx_k_numpy[] =
"numpy";
2728 static const char __pyx_k_range[] =
"range";
2729 static const char __pyx_k_shape[] =
"shape";
2730 static const char __pyx_k_start[] =
"start";
2731 static const char __pyx_k_astype[] =
"astype";
2732 static const char __pyx_k_encode[] =
"encode";
2733 static const char __pyx_k_format[] =
"format";
2734 static const char __pyx_k_import[] =
"__import__";
2735 static const char __pyx_k_indptr[] =
"indptr";
2736 static const char __pyx_k_name_2[] =
"__name__";
2737 static const char __pyx_k_pickle[] =
"pickle";
2738 static const char __pyx_k_reduce[] =
"__reduce__";
2739 static const char __pyx_k_struct[] =
"struct";
2740 static const char __pyx_k_unpack[] =
"unpack";
2741 static const char __pyx_k_update[] =
"update";
2742 static const char __pyx_k_float32[] =
"float32";
2743 static const char __pyx_k_float64[] =
"float64";
2744 static const char __pyx_k_fortran[] =
"fortran";
2745 static const char __pyx_k_indices[] =
"indices";
2746 static const char __pyx_k_memview[] =
"memview";
2747 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2748 static const char __pyx_k_float128[] =
"float128";
2749 static const char __pyx_k_getstate[] =
"__getstate__";
2750 static const char __pyx_k_issparse[] =
"issparse";
2751 static const char __pyx_k_itemsize[] =
"itemsize";
2752 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2753 static const char __pyx_k_setstate[] =
"__setstate__";
2754 static const char __pyx_k_A_indices[] =
"A_indices";
2755 static const char __pyx_k_TypeError[] =
"TypeError";
2756 static const char __pyx_k_enumerate[] =
"enumerate";
2757 static const char __pyx_k_pycMatrix[] =
"pycMatrix";
2758 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2759 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2760 static const char __pyx_k_A_num_rows[] =
"A_num_rows";
2761 static const char __pyx_k_IndexError[] =
"IndexError";
2762 static const char __pyx_k_ValueError[] =
"ValueError";
2763 static const char __pyx_k_csr_matrix[] =
"csr_matrix";
2764 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2765 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2766 static const char __pyx_k_MemoryError[] =
"MemoryError";
2767 static const char __pyx_k_PickleError[] =
"PickleError";
2768 static const char __pyx_k_A_data_float[] =
"A_data_float";
2769 static const char __pyx_k_A_indices_mv[] =
"A_indices_mv";
2770 static const char __pyx_k_C_CONTIGUOUS[] =
"C_CONTIGUOUS";
2771 static const char __pyx_k_F_CONTIGUOUS[] =
"F_CONTIGUOUS";
2772 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2773 static const char __pyx_k_scipy_sparse[] =
"scipy.sparse";
2774 static const char __pyx_k_sort_indices[] =
"sort_indices";
2775 static const char __pyx_k_stringsource[] =
"stringsource";
2776 static const char __pyx_k_A_data_double[] =
"A_data_double";
2777 static const char __pyx_k_A_num_columns[] =
"A_num_columns";
2778 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2779 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2780 static const char __pyx_k_A_is_row_major[] =
"A_is_row_major";
2781 static const char __pyx_k_isspmatrix_csc[] =
"isspmatrix_csc";
2782 static const char __pyx_k_isspmatrix_csr[] =
"isspmatrix_csr";
2783 static const char __pyx_k_A_data_float_mv[] =
"A_data_float_mv";
2784 static const char __pyx_k_A_index_pointer[] =
"A_index_pointer";
2785 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2786 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2787 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2788 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2789 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2790 static const char __pyx_k_A_cannot_be_None[] =
"A cannot be None.";
2791 static const char __pyx_k_A_data_double_mv[] =
"A_data_double_mv";
2792 static const char __pyx_k_A_data_float_mv_c[] =
"A_data_float_mv_c";
2793 static const char __pyx_k_A_data_float_mv_f[] =
"A_data_float_mv_f";
2794 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2795 static const char __pyx_k_A_data_double_mv_c[] =
"A_data_double_mv_c";
2796 static const char __pyx_k_A_data_double_mv_f[] =
"A_data_double_mv_f";
2797 static const char __pyx_k_A_data_long_double[] =
"A_data_long_double";
2798 static const char __pyx_k_A_index_pointer_mv[] =
"A_index_pointer_mv";
2799 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2800 static const char __pyx_k_has_sorted_indices[] =
"has_sorted_indices";
2801 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2802 static const char __pyx_k_set_csc_matrix_float[] =
"set_csc_matrix_float";
2803 static const char __pyx_k_set_csr_matrix_float[] =
"set_csr_matrix_float";
2804 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2805 static const char __pyx_k_A_data_long_double_mv[] =
"A_data_long_double_mv";
2806 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2807 static const char __pyx_k_set_csc_matrix_double[] =
"set_csc_matrix_double";
2808 static const char __pyx_k_set_csr_matrix_double[] =
"set_csr_matrix_double";
2809 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2810 static const char __pyx_k_set_dense_matrix_float[] =
"set_dense_matrix_float";
2811 static const char __pyx_k_A_data_long_double_mv_c[] =
"A_data_long_double_mv_c";
2812 static const char __pyx_k_A_data_long_double_mv_f[] =
"A_data_long_double_mv_f";
2813 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2814 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2815 static const char __pyx_k_set_dense_matrix_double[] =
"set_dense_matrix_double";
2816 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2817 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2818 static const char __pyx_k_pycMatrix___reduce_cython[] =
"pycMatrix.__reduce_cython__";
2819 static const char __pyx_k_set_csc_matrix_long_double[] =
"set_csc_matrix_long_double";
2820 static const char __pyx_k_set_csr_matrix_long_double[] =
"set_csr_matrix_long_double";
2821 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2822 static const char __pyx_k_pycMatrix___setstate_cython[] =
"pycMatrix.__setstate_cython__";
2823 static const char __pyx_k_set_dense_matrix_long_double[] =
"set_dense_matrix_long_double";
2824 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2825 static const char __pyx_k_pycMatrix_set_csc_matrix_float[] =
"pycMatrix.set_csc_matrix_float";
2826 static const char __pyx_k_pycMatrix_set_csr_matrix_float[] =
"pycMatrix.set_csr_matrix_float";
2827 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2828 static const char __pyx_k_pycMatrix_set_csc_matrix_double[] =
"pycMatrix.set_csc_matrix_double";
2829 static const char __pyx_k_pycMatrix_set_csr_matrix_double[] =
"pycMatrix.set_csr_matrix_double";
2830 static const char __pyx_k_pycMatrix_set_dense_matrix_long[] =
"pycMatrix.set_dense_matrix_long_double";
2831 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2832 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2833 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2834 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2835 static const char __pyx_k_Data_type_should_be_float32_floa[] =
"Data type should be \"float32\", \"float64\", or \"float128\".";
2836 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2837 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2838 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2839 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] =
"Input matrix should be a 2-dimensional array.";
2840 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2841 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] =
"Matrix A should be either C or F contiguous.";
2842 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2843 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2844 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2845 static const char __pyx_k_imate__c_linear_operator_py_c_ma[] =
"imate/_c_linear_operator/py_c_matrix.pyx";
2846 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2847 static const char __pyx_k_pycMatrix_set_csc_matrix_long_do[] =
"pycMatrix.set_csc_matrix_long_double";
2848 static const char __pyx_k_pycMatrix_set_csr_matrix_long_do[] =
"pycMatrix.set_csr_matrix_long_double";
2849 static const char __pyx_k_pycMatrix_set_dense_matrix_doubl[] =
"pycMatrix.set_dense_matrix_double";
2850 static const char __pyx_k_pycMatrix_set_dense_matrix_float[] =
"pycMatrix.set_dense_matrix_float";
2851 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2852 static const char __pyx_k_imate__c_linear_operator_py_c_ma_2[] =
"imate._c_linear_operator.py_c_matrix";
2853 static PyObject *__pyx_n_s_A;
2854 static PyObject *__pyx_n_s_ASCII;
2855 static PyObject *__pyx_kp_u_A_cannot_be_None;
2856 static PyObject *__pyx_n_s_A_data_double;
2857 static PyObject *__pyx_n_s_A_data_double_mv;
2858 static PyObject *__pyx_n_s_A_data_double_mv_c;
2859 static PyObject *__pyx_n_s_A_data_double_mv_f;
2860 static PyObject *__pyx_n_s_A_data_float;
2861 static PyObject *__pyx_n_s_A_data_float_mv;
2862 static PyObject *__pyx_n_s_A_data_float_mv_c;
2863 static PyObject *__pyx_n_s_A_data_float_mv_f;
2864 static PyObject *__pyx_n_s_A_data_long_double;
2865 static PyObject *__pyx_n_s_A_data_long_double_mv;
2866 static PyObject *__pyx_n_s_A_data_long_double_mv_c;
2867 static PyObject *__pyx_n_s_A_data_long_double_mv_f;
2868 static PyObject *__pyx_n_s_A_index_pointer;
2869 static PyObject *__pyx_n_s_A_index_pointer_mv;
2870 static PyObject *__pyx_n_s_A_indices;
2871 static PyObject *__pyx_n_s_A_indices_mv;
2872 static PyObject *__pyx_n_s_A_is_row_major;
2873 static PyObject *__pyx_n_s_A_num_columns;
2874 static PyObject *__pyx_n_s_A_num_rows;
2875 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2876 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2877 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2878 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2879 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2880 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2881 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2882 static PyObject *__pyx_n_s_Ellipsis;
2883 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2884 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2885 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2886 static PyObject *__pyx_n_s_IndexError;
2887 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2888 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2889 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2890 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2891 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2892 static PyObject *__pyx_n_s_MemoryError;
2893 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2894 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2895 static PyObject *__pyx_n_b_O;
2896 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2897 static PyObject *__pyx_n_s_PickleError;
2898 static PyObject *__pyx_n_s_TypeError;
2899 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2900 static PyObject *__pyx_n_s_ValueError;
2901 static PyObject *__pyx_n_s_View_MemoryView;
2902 static PyObject *__pyx_n_s_allocate_buffer;
2903 static PyObject *__pyx_n_s_astype;
2904 static PyObject *__pyx_n_s_base;
2905 static PyObject *__pyx_n_s_c;
2906 static PyObject *__pyx_n_u_c;
2907 static PyObject *__pyx_n_s_class;
2908 static PyObject *__pyx_n_s_cline_in_traceback;
2909 static PyObject *__pyx_kp_s_contiguous_and_direct;
2910 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2911 static PyObject *__pyx_n_s_copy;
2912 static PyObject *__pyx_n_s_csr_matrix;
2913 static PyObject *__pyx_n_s_data;
2914 static PyObject *__pyx_n_s_dict;
2915 static PyObject *__pyx_n_s_dtype;
2916 static PyObject *__pyx_n_s_dtype_is_object;
2917 static PyObject *__pyx_n_s_encode;
2918 static PyObject *__pyx_n_s_enumerate;
2919 static PyObject *__pyx_n_s_error;
2920 static PyObject *__pyx_n_s_flags;
2921 static PyObject *__pyx_n_b_float128;
2922 static PyObject *__pyx_n_b_float32;
2923 static PyObject *__pyx_n_b_float64;
2924 static PyObject *__pyx_n_s_format;
2925 static PyObject *__pyx_n_s_fortran;
2926 static PyObject *__pyx_n_u_fortran;
2927 static PyObject *__pyx_n_s_getstate;
2928 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2929 static PyObject *__pyx_n_s_has_sorted_indices;
2930 static PyObject *__pyx_n_s_id;
2931 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_ma;
2932 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_ma_2;
2933 static PyObject *__pyx_n_s_import;
2934 static PyObject *__pyx_n_s_indices;
2935 static PyObject *__pyx_n_s_indptr;
2936 static PyObject *__pyx_n_s_issparse;
2937 static PyObject *__pyx_n_s_isspmatrix_csc;
2938 static PyObject *__pyx_n_s_isspmatrix_csr;
2939 static PyObject *__pyx_n_s_itemsize;
2940 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2941 static PyObject *__pyx_n_s_main;
2942 static PyObject *__pyx_n_s_memview;
2943 static PyObject *__pyx_n_s_mode;
2944 static PyObject *__pyx_n_s_name;
2945 static PyObject *__pyx_n_s_name_2;
2946 static PyObject *__pyx_n_s_ndim;
2947 static PyObject *__pyx_n_s_new;
2948 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2949 static PyObject *__pyx_n_s_numpy;
2950 static PyObject *__pyx_n_s_obj;
2951 static PyObject *__pyx_n_s_pack;
2952 static PyObject *__pyx_n_s_pickle;
2953 static PyObject *__pyx_n_s_pycMatrix;
2954 static PyObject *__pyx_n_s_pycMatrix___reduce_cython;
2955 static PyObject *__pyx_n_s_pycMatrix___setstate_cython;
2956 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_double;
2957 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_float;
2958 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_long_do;
2959 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_double;
2960 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_float;
2961 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_long_do;
2962 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_doubl;
2963 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_float;
2964 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_long;
2965 static PyObject *__pyx_n_s_pyx_PickleError;
2966 static PyObject *__pyx_n_s_pyx_checksum;
2967 static PyObject *__pyx_n_s_pyx_getbuffer;
2968 static PyObject *__pyx_n_s_pyx_result;
2969 static PyObject *__pyx_n_s_pyx_state;
2970 static PyObject *__pyx_n_s_pyx_type;
2971 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2972 static PyObject *__pyx_n_s_pyx_vtable;
2973 static PyObject *__pyx_n_s_range;
2974 static PyObject *__pyx_n_s_reduce;
2975 static PyObject *__pyx_n_s_reduce_cython;
2976 static PyObject *__pyx_n_s_reduce_ex;
2977 static PyObject *__pyx_n_s_scipy_sparse;
2978 static PyObject *__pyx_n_s_self;
2979 static PyObject *__pyx_n_s_set_csc_matrix_double;
2980 static PyObject *__pyx_n_s_set_csc_matrix_float;
2981 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2982 static PyObject *__pyx_n_s_set_csr_matrix_double;
2983 static PyObject *__pyx_n_s_set_csr_matrix_float;
2984 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2985 static PyObject *__pyx_n_s_set_dense_matrix_double;
2986 static PyObject *__pyx_n_s_set_dense_matrix_float;
2987 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2988 static PyObject *__pyx_n_s_setstate;
2989 static PyObject *__pyx_n_s_setstate_cython;
2990 static PyObject *__pyx_n_s_shape;
2991 static PyObject *__pyx_n_s_size;
2992 static PyObject *__pyx_n_s_sort_indices;
2993 static PyObject *__pyx_n_s_start;
2994 static PyObject *__pyx_n_s_step;
2995 static PyObject *__pyx_n_s_stop;
2996 static PyObject *__pyx_kp_s_strided_and_direct;
2997 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2998 static PyObject *__pyx_kp_s_strided_and_indirect;
2999 static PyObject *__pyx_kp_s_stringsource;
3000 static PyObject *__pyx_n_s_struct;
3001 static PyObject *__pyx_n_s_test;
3002 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3003 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3004 static PyObject *__pyx_n_s_unpack;
3005 static PyObject *__pyx_n_s_update;
3006 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3007 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3008 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3009 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3010 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3011 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3012 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3013 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3014 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3015 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
3016 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self);
3017 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3018 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
3019 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3020 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
3021 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
3022 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
3023 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
3024 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
3025 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
3026 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
3027 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3028 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
3029 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3030 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
3031 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3032 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
3033 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
3034 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
3035 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
3036 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
3037 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3038 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3039 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3040 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3041 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3042 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3043 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3044 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
3046 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
3047 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
3048 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
3049 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3050 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
3051 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
3052 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
3053 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
3054 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3055 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3056 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3057 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
3058 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
3059 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
3060 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k);
3061 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
3062 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
3063 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
3064 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
3065 static PyObject *__pyx_int_0;
3066 static PyObject *__pyx_int_1;
3067 static PyObject *__pyx_int_2;
3068 static PyObject *__pyx_int_112105877;
3069 static PyObject *__pyx_int_136983863;
3070 static PyObject *__pyx_int_184977713;
3071 static PyObject *__pyx_int_neg_1;
3072 static PyObject *__pyx_tuple_;
3073 static PyObject *__pyx_tuple__2;
3074 static PyObject *__pyx_tuple__3;
3075 static PyObject *__pyx_tuple__5;
3076 static PyObject *__pyx_slice__32;
3077 static PyObject *__pyx_tuple__15;
3078 static PyObject *__pyx_tuple__17;
3079 static PyObject *__pyx_tuple__18;
3080 static PyObject *__pyx_tuple__19;
3081 static PyObject *__pyx_tuple__20;
3082 static PyObject *__pyx_tuple__21;
3083 static PyObject *__pyx_tuple__22;
3084 static PyObject *__pyx_tuple__23;
3085 static PyObject *__pyx_tuple__24;
3086 static PyObject *__pyx_tuple__25;
3087 static PyObject *__pyx_tuple__26;
3088 static PyObject *__pyx_tuple__27;
3089 static PyObject *__pyx_tuple__28;
3090 static PyObject *__pyx_tuple__29;
3091 static PyObject *__pyx_tuple__30;
3092 static PyObject *__pyx_tuple__31;
3093 static PyObject *__pyx_tuple__33;
3094 static PyObject *__pyx_tuple__34;
3095 static PyObject *__pyx_tuple__35;
3096 static PyObject *__pyx_tuple__37;
3097 static PyObject *__pyx_tuple__38;
3098 static PyObject *__pyx_tuple__39;
3099 static PyObject *__pyx_tuple__40;
3100 static PyObject *__pyx_tuple__41;
3101 static PyObject *__pyx_tuple__42;
3102 static PyObject *__pyx_tuple__43;
3103 static PyObject *__pyx_tuple__44;
3104 static PyObject *__pyx_tuple__45;
3105 static PyObject *__pyx_tuple__46;
3106 static PyObject *__pyx_tuple__47;
3107 static PyObject *__pyx_tuple__48;
3108 static PyObject *__pyx_tuple__49;
3109 static PyObject *__pyx_tuple__50;
3110 static PyObject *__pyx_tuple__51;
3111 static PyObject *__pyx_tuple__52;
3112 static PyObject *__pyx_tuple__53;
3113 static PyObject *__pyx_tuple__54;
3114 static PyObject *__pyx_codeobj__4;
3115 static PyObject *__pyx_codeobj__6;
3116 static PyObject *__pyx_codeobj__7;
3117 static PyObject *__pyx_codeobj__8;
3118 static PyObject *__pyx_codeobj__9;
3119 static PyObject *__pyx_codeobj__10;
3120 static PyObject *__pyx_codeobj__11;
3121 static PyObject *__pyx_codeobj__12;
3122 static PyObject *__pyx_codeobj__13;
3123 static PyObject *__pyx_codeobj__14;
3124 static PyObject *__pyx_codeobj__16;
3125 static PyObject *__pyx_codeobj__36;
3137 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3138 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3139 PyObject *__pyx_v_A = 0;
3140 int __pyx_lineno = 0;
3141 const char *__pyx_filename = NULL;
3142 int __pyx_clineno = 0;
3144 __Pyx_RefNannyDeclarations
3145 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3147 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,0};
3148 PyObject* values[1] = {0};
3149 if (unlikely(__pyx_kwds)) {
3151 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3153 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3156 default:
goto __pyx_L5_argtuple_error;
3158 kw_args = PyDict_Size(__pyx_kwds);
3161 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3162 else goto __pyx_L5_argtuple_error;
3164 if (unlikely(kw_args > 0)) {
3165 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
3167 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3168 goto __pyx_L5_argtuple_error;
3170 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3172 __pyx_v_A = values[0];
3174 goto __pyx_L4_argument_unpacking_done;
3175 __pyx_L5_argtuple_error:;
3176 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
3178 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3179 __Pyx_RefNannyFinishContext();
3181 __pyx_L4_argument_unpacking_done:;
3182 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), __pyx_v_A);
3185 __Pyx_RefNannyFinishContext();
3189 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
3191 __Pyx_TraceDeclarations
3192 __Pyx_RefNannyDeclarations
3195 PyObject *__pyx_t_3 = NULL;
3196 PyObject *__pyx_t_4 = NULL;
3197 PyObject *__pyx_t_5 = NULL;
3198 int __pyx_lineno = 0;
3199 const char *__pyx_filename = NULL;
3200 int __pyx_clineno = 0;
3201 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3202 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
3211 __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3212 __pyx_t_1 = (__pyx_v_A == Py_None);
3213 __pyx_t_2 = (__pyx_t_1 != 0);
3214 if (unlikely(__pyx_t_2)) {
3223 __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
3224 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
3225 __Pyx_GOTREF(__pyx_t_3);
3226 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3228 __PYX_ERR(0, 126, __pyx_L1_error)
3246 __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
3247 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
3248 __Pyx_GOTREF(__pyx_t_3);
3249 __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
3250 __Pyx_GOTREF(__pyx_t_4);
3251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3252 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
3253 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3254 if (unlikely(__pyx_t_2)) {
3263 __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
3264 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
3265 __Pyx_GOTREF(__pyx_t_4);
3266 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3267 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3268 __PYX_ERR(0, 129, __pyx_L1_error)
3286 __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
3287 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
3288 __Pyx_GOTREF(__pyx_t_4);
3289 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
3290 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3300 __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
3301 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float32");
3320 __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
3321 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3322 __Pyx_GOTREF(__pyx_t_4);
3323 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
3324 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3334 __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
3335 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float64");
3354 __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
3355 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
3356 __Pyx_GOTREF(__pyx_t_4);
3357 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
3358 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3359 if (likely(__pyx_t_2)) {
3368 __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3369 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float128");
3388 __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3390 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3391 __Pyx_GOTREF(__pyx_t_4);
3392 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3393 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3394 __PYX_ERR(0, 142, __pyx_L1_error)
3405 __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
3406 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3407 __Pyx_GOTREF(__pyx_t_3);
3409 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3410 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3411 if (likely(__pyx_t_5)) {
3412 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3413 __Pyx_INCREF(__pyx_t_5);
3414 __Pyx_INCREF(
function);
3415 __Pyx_DECREF_SET(__pyx_t_3,
function);
3418 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3419 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3420 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3421 __Pyx_GOTREF(__pyx_t_4);
3422 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3423 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3424 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3434 __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
3435 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
3436 __Pyx_GOTREF(__pyx_t_3);
3438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3439 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3440 if (likely(__pyx_t_5)) {
3441 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3442 __Pyx_INCREF(__pyx_t_5);
3443 __Pyx_INCREF(
function);
3444 __Pyx_DECREF_SET(__pyx_t_3,
function);
3447 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3448 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3449 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
3450 __Pyx_GOTREF(__pyx_t_4);
3451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3452 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3453 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3463 __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
3464 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3465 __Pyx_GOTREF(__pyx_t_4);
3466 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3467 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3468 __pyx_t_1 = ((!__pyx_t_2) != 0);
3478 __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
3479 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3480 __Pyx_GOTREF(__pyx_t_3);
3482 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3483 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3484 if (likely(__pyx_t_5)) {
3485 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3486 __Pyx_INCREF(__pyx_t_5);
3487 __Pyx_INCREF(
function);
3488 __Pyx_DECREF_SET(__pyx_t_3,
function);
3491 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3492 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3493 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3494 __Pyx_GOTREF(__pyx_t_4);
3495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3496 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3514 __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
3515 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3516 __Pyx_GOTREF(__pyx_t_4);
3517 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3518 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3528 __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3529 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3530 __Pyx_GOTREF(__pyx_t_3);
3532 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3533 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3534 if (likely(__pyx_t_5)) {
3535 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3536 __Pyx_INCREF(__pyx_t_5);
3537 __Pyx_INCREF(
function);
3538 __Pyx_DECREF_SET(__pyx_t_3,
function);
3541 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3542 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3543 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3544 __Pyx_GOTREF(__pyx_t_4);
3545 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3546 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3565 __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
3566 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3567 __Pyx_GOTREF(__pyx_t_4);
3568 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3569 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3579 __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
3580 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
3581 __Pyx_GOTREF(__pyx_t_3);
3583 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3584 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3585 if (likely(__pyx_t_5)) {
3586 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3587 __Pyx_INCREF(__pyx_t_5);
3588 __Pyx_INCREF(
function);
3589 __Pyx_DECREF_SET(__pyx_t_3,
function);
3592 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3593 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3594 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3595 __Pyx_GOTREF(__pyx_t_4);
3596 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3616 __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
3617 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3618 __Pyx_GOTREF(__pyx_t_4);
3619 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
3620 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3630 __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
3631 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3632 __Pyx_GOTREF(__pyx_t_3);
3634 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3635 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3636 if (likely(__pyx_t_5)) {
3637 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3638 __Pyx_INCREF(__pyx_t_5);
3639 __Pyx_INCREF(
function);
3640 __Pyx_DECREF_SET(__pyx_t_3,
function);
3643 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3644 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3645 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3646 __Pyx_GOTREF(__pyx_t_4);
3647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3648 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3677 __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
3678 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
3679 __Pyx_GOTREF(__pyx_t_3);
3681 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3682 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3683 if (likely(__pyx_t_5)) {
3684 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3685 __Pyx_INCREF(__pyx_t_5);
3686 __Pyx_INCREF(
function);
3687 __Pyx_DECREF_SET(__pyx_t_3,
function);
3690 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3691 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3692 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3693 __Pyx_GOTREF(__pyx_t_4);
3694 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3695 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3696 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3706 __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
3707 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
3708 __Pyx_GOTREF(__pyx_t_4);
3709 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
3710 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3711 __pyx_t_2 = ((!__pyx_t_1) != 0);
3721 __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
3722 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
3723 __Pyx_GOTREF(__pyx_t_3);
3725 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3726 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3727 if (likely(__pyx_t_5)) {
3728 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3729 __Pyx_INCREF(__pyx_t_5);
3730 __Pyx_INCREF(
function);
3731 __Pyx_DECREF_SET(__pyx_t_3,
function);
3734 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3735 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3736 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
3737 __Pyx_GOTREF(__pyx_t_4);
3738 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3739 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3757 __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error))
3758 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
3759 __Pyx_GOTREF(__pyx_t_4);
3760 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3771 __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
3772 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
3773 __Pyx_GOTREF(__pyx_t_3);
3775 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3776 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3777 if (likely(__pyx_t_5)) {
3778 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3779 __Pyx_INCREF(__pyx_t_5);
3780 __Pyx_INCREF(
function);
3781 __Pyx_DECREF_SET(__pyx_t_3,
function);
3784 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3785 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3786 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3787 __Pyx_GOTREF(__pyx_t_4);
3788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3789 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3808 __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
3809 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3810 __Pyx_GOTREF(__pyx_t_4);
3811 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3822 __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
3823 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
3824 __Pyx_GOTREF(__pyx_t_3);
3826 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3827 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3828 if (likely(__pyx_t_5)) {
3829 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3830 __Pyx_INCREF(__pyx_t_5);
3831 __Pyx_INCREF(
function);
3832 __Pyx_DECREF_SET(__pyx_t_3,
function);
3835 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3836 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3837 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
3838 __Pyx_GOTREF(__pyx_t_4);
3839 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3840 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3859 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3860 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
3861 __Pyx_GOTREF(__pyx_t_4);
3862 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
3863 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3873 __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3874 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3875 __Pyx_GOTREF(__pyx_t_3);
3877 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3878 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3879 if (likely(__pyx_t_5)) {
3880 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3881 __Pyx_INCREF(__pyx_t_5);
3882 __Pyx_INCREF(
function);
3883 __Pyx_DECREF_SET(__pyx_t_3,
function);
3886 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3887 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3888 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
3889 __Pyx_GOTREF(__pyx_t_4);
3890 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3891 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3920 __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
3922 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
3923 __Pyx_GOTREF(__pyx_t_3);
3925 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3926 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3927 if (likely(__pyx_t_5)) {
3928 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3929 __Pyx_INCREF(__pyx_t_5);
3930 __Pyx_INCREF(
function);
3931 __Pyx_DECREF_SET(__pyx_t_3,
function);
3934 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3935 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3936 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
3937 __Pyx_GOTREF(__pyx_t_4);
3938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3939 __Pyx_GIVEREF(__pyx_t_4);
3940 __Pyx_GOTREF(__pyx_v_self->A_csr);
3941 __Pyx_DECREF(__pyx_v_self->A_csr);
3942 __pyx_v_self->A_csr = __pyx_t_4;
3952 __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3953 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3954 __Pyx_GOTREF(__pyx_t_4);
3955 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3957 __pyx_t_1 = ((!__pyx_t_2) != 0);
3967 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3968 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
3969 __Pyx_GOTREF(__pyx_t_3);
3971 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3972 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3973 if (likely(__pyx_t_5)) {
3974 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3975 __Pyx_INCREF(__pyx_t_5);
3976 __Pyx_INCREF(
function);
3977 __Pyx_DECREF_SET(__pyx_t_3,
function);
3980 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3981 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3982 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
3983 __Pyx_GOTREF(__pyx_t_4);
3984 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4003 __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
4004 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
4005 __Pyx_GOTREF(__pyx_t_4);
4006 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
4007 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4017 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
4018 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
4019 __Pyx_GOTREF(__pyx_t_3);
4021 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4022 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4023 if (likely(__pyx_t_5)) {
4024 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4025 __Pyx_INCREF(__pyx_t_5);
4026 __Pyx_INCREF(
function);
4027 __Pyx_DECREF_SET(__pyx_t_3,
function);
4030 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4031 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4032 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
4033 __Pyx_GOTREF(__pyx_t_4);
4034 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4035 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4054 __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
4055 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
4056 __Pyx_GOTREF(__pyx_t_4);
4057 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
4058 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4068 __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
4069 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
4070 __Pyx_GOTREF(__pyx_t_3);
4072 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4073 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4074 if (likely(__pyx_t_5)) {
4075 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4076 __Pyx_INCREF(__pyx_t_5);
4077 __Pyx_INCREF(
function);
4078 __Pyx_DECREF_SET(__pyx_t_3,
function);
4081 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4082 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4083 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
4084 __Pyx_GOTREF(__pyx_t_4);
4085 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4086 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4105 __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error))
4106 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
4107 __Pyx_GOTREF(__pyx_t_4);
4108 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
4109 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4119 __Pyx_TraceLine(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
4120 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
4121 __Pyx_GOTREF(__pyx_t_3);
4123 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4124 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4125 if (likely(__pyx_t_5)) {
4126 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4127 __Pyx_INCREF(__pyx_t_5);
4128 __Pyx_INCREF(
function);
4129 __Pyx_DECREF_SET(__pyx_t_3,
function);
4132 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
4133 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4134 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
4135 __Pyx_GOTREF(__pyx_t_4);
4136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4137 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4168 __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
4170 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
4171 __Pyx_GOTREF(__pyx_t_4);
4172 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
4173 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4183 __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
4184 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4185 __Pyx_GOTREF(__pyx_t_3);
4187 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4188 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4189 if (likely(__pyx_t_5)) {
4190 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4191 __Pyx_INCREF(__pyx_t_5);
4192 __Pyx_INCREF(
function);
4193 __Pyx_DECREF_SET(__pyx_t_3,
function);
4196 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4197 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4198 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
4199 __Pyx_GOTREF(__pyx_t_4);
4200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4201 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4220 __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
4221 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
4222 __Pyx_GOTREF(__pyx_t_4);
4223 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
4224 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4234 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4235 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
4236 __Pyx_GOTREF(__pyx_t_3);
4238 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4239 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4240 if (likely(__pyx_t_5)) {
4241 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4242 __Pyx_INCREF(__pyx_t_5);
4243 __Pyx_INCREF(
function);
4244 __Pyx_DECREF_SET(__pyx_t_3,
function);
4247 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4248 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4249 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
4250 __Pyx_GOTREF(__pyx_t_4);
4251 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4252 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4271 __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
4272 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
4273 __Pyx_GOTREF(__pyx_t_4);
4274 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
4275 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4285 __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
4286 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4287 __Pyx_GOTREF(__pyx_t_3);
4289 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4290 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
4291 if (likely(__pyx_t_5)) {
4292 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4293 __Pyx_INCREF(__pyx_t_5);
4294 __Pyx_INCREF(
function);
4295 __Pyx_DECREF_SET(__pyx_t_3,
function);
4298 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4299 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4300 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
4301 __Pyx_GOTREF(__pyx_t_4);
4302 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4329 __Pyx_XDECREF(__pyx_t_3);
4330 __Pyx_XDECREF(__pyx_t_4);
4331 __Pyx_XDECREF(__pyx_t_5);
4332 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4335 __Pyx_TraceReturn(Py_None, 0);
4336 __Pyx_RefNannyFinishContext();
4349 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4350 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float[] =
"pycMatrix.set_dense_matrix_float(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4351 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float = {
"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float};
4352 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4353 PyObject *__pyx_r = 0;
4354 __Pyx_RefNannyDeclarations
4355 __Pyx_RefNannySetupContext(
"set_dense_matrix_float (wrapper)", 0);
4356 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4359 __Pyx_RefNannyFinishContext();
4363 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4364 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4365 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4366 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4367 __Pyx_memviewslice __pyx_v_A_data_float_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4368 __Pyx_memviewslice __pyx_v_A_data_float_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4369 float *__pyx_v_A_data_float;
4370 PyObject *__pyx_r = NULL;
4371 __Pyx_TraceDeclarations
4372 __Pyx_RefNannyDeclarations
4373 PyObject *__pyx_t_1 = NULL;
4374 PyObject *__pyx_t_2 = NULL;
4375 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4377 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4378 Py_ssize_t __pyx_t_6;
4379 Py_ssize_t __pyx_t_7;
4380 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4382 int __pyx_lineno = 0;
4383 const char *__pyx_filename = NULL;
4384 int __pyx_clineno = 0;
4385 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4386 __Pyx_RefNannySetupContext(
"set_dense_matrix_float", 0);
4387 __Pyx_TraceCall(
"set_dense_matrix_float", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
4396 __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
4397 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
4398 __Pyx_GOTREF(__pyx_t_1);
4399 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
4400 __Pyx_GOTREF(__pyx_t_2);
4401 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4402 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4404 __pyx_v_A_num_rows = __pyx_t_3;
4413 __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
4414 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
4415 __Pyx_GOTREF(__pyx_t_2);
4416 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
4417 __Pyx_GOTREF(__pyx_t_1);
4418 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4419 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
4420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4421 __pyx_v_A_num_columns = __pyx_t_3;
4430 __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4431 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4432 __Pyx_GOTREF(__pyx_t_1);
4433 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4434 __Pyx_GOTREF(__pyx_t_2);
4435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
4437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4447 __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
4448 __pyx_v_A_is_row_major = 1;
4467 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4468 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
4469 __Pyx_GOTREF(__pyx_t_2);
4470 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
4471 __Pyx_GOTREF(__pyx_t_1);
4472 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4473 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
4474 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4475 if (likely(__pyx_t_4)) {
4484 __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
4485 __pyx_v_A_is_row_major = 0;
4504 __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
4506 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
4507 __Pyx_GOTREF(__pyx_t_1);
4508 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4509 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4510 __PYX_ERR(0, 235, __pyx_L1_error)
4521 __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4522 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4532 __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4533 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
4534 __pyx_v_A_data_float_mv_c = __pyx_t_5;
4535 __pyx_t_5.memview = NULL;
4536 __pyx_t_5.data = NULL;
4545 __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4548 __pyx_v_A_data_float = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_A_data_float_mv_c.data + __pyx_t_6 * __pyx_v_A_data_float_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4567 __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
4569 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
4570 __pyx_v_A_data_float_mv_f = __pyx_t_8;
4571 __pyx_t_8.memview = NULL;
4572 __pyx_t_8.data = NULL;
4581 __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
4584 __pyx_v_A_data_float = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_A_data_float_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_float_mv_f.strides[1]) ))));
4595 __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
4597 __pyx_t_9 =
new cDenseMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4599 __Pyx_CppExn2PyErr();
4600 __PYX_ERR(0, 262, __pyx_L1_error)
4602 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
4613 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4616 __Pyx_XDECREF(__pyx_t_1);
4617 __Pyx_XDECREF(__pyx_t_2);
4618 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4619 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4620 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4623 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_c, 1);
4624 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_f, 1);
4625 __Pyx_XGIVEREF(__pyx_r);
4626 __Pyx_TraceReturn(__pyx_r, 0);
4627 __Pyx_RefNannyFinishContext();
4640 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4641 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double[] =
"pycMatrix.set_dense_matrix_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4642 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double = {
"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double};
4643 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4644 PyObject *__pyx_r = 0;
4645 __Pyx_RefNannyDeclarations
4646 __Pyx_RefNannySetupContext(
"set_dense_matrix_double (wrapper)", 0);
4647 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4650 __Pyx_RefNannyFinishContext();
4654 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4655 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4656 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4657 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4658 __Pyx_memviewslice __pyx_v_A_data_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4659 __Pyx_memviewslice __pyx_v_A_data_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4660 double *__pyx_v_A_data_double;
4661 PyObject *__pyx_r = NULL;
4662 __Pyx_TraceDeclarations
4663 __Pyx_RefNannyDeclarations
4664 PyObject *__pyx_t_1 = NULL;
4665 PyObject *__pyx_t_2 = NULL;
4666 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4668 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4669 Py_ssize_t __pyx_t_6;
4670 Py_ssize_t __pyx_t_7;
4671 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4673 int __pyx_lineno = 0;
4674 const char *__pyx_filename = NULL;
4675 int __pyx_clineno = 0;
4676 __Pyx_TraceFrameInit(__pyx_codeobj__6)
4677 __Pyx_RefNannySetupContext(
"set_dense_matrix_double", 0);
4678 __Pyx_TraceCall(
"set_dense_matrix_double", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
4687 __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
4688 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
4689 __Pyx_GOTREF(__pyx_t_1);
4690 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
4691 __Pyx_GOTREF(__pyx_t_2);
4692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4693 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4695 __pyx_v_A_num_rows = __pyx_t_3;
4704 __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4705 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
4706 __Pyx_GOTREF(__pyx_t_2);
4707 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
4708 __Pyx_GOTREF(__pyx_t_1);
4709 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4710 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
4711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4712 __pyx_v_A_num_columns = __pyx_t_3;
4721 __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4722 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
4723 __Pyx_GOTREF(__pyx_t_1);
4724 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
4725 __Pyx_GOTREF(__pyx_t_2);
4726 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4727 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4728 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4738 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4739 __pyx_v_A_is_row_major = 1;
4758 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4759 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4760 __Pyx_GOTREF(__pyx_t_2);
4761 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
4762 __Pyx_GOTREF(__pyx_t_1);
4763 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4764 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
4765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4766 if (likely(__pyx_t_4)) {
4775 __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4776 __pyx_v_A_is_row_major = 0;
4795 __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error))
4797 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_1);
4799 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4800 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4801 __PYX_ERR(0, 291, __pyx_L1_error)
4812 __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error))
4813 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4823 __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error))
4824 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
4825 __pyx_v_A_data_double_mv_c = __pyx_t_5;
4826 __pyx_t_5.memview = NULL;
4827 __pyx_t_5.data = NULL;
4836 __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
4839 __pyx_v_A_data_double = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_A_data_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4858 __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
4860 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
4861 __pyx_v_A_data_double_mv_f = __pyx_t_8;
4862 __pyx_t_8.memview = NULL;
4863 __pyx_t_8.data = NULL;
4872 __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
4875 __pyx_v_A_data_double = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_A_data_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_double_mv_f.strides[1]) ))));
4886 __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
4888 __pyx_t_9 =
new cDenseMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4890 __Pyx_CppExn2PyErr();
4891 __PYX_ERR(0, 318, __pyx_L1_error)
4893 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
4904 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4907 __Pyx_XDECREF(__pyx_t_1);
4908 __Pyx_XDECREF(__pyx_t_2);
4909 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4910 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4911 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4914 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_c, 1);
4915 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_f, 1);
4916 __Pyx_XGIVEREF(__pyx_r);
4917 __Pyx_TraceReturn(__pyx_r, 0);
4918 __Pyx_RefNannyFinishContext();
4931 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4932 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double[] =
"pycMatrix.set_dense_matrix_long_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4933 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double = {
"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double};
4934 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4935 PyObject *__pyx_r = 0;
4936 __Pyx_RefNannyDeclarations
4937 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double (wrapper)", 0);
4938 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4941 __Pyx_RefNannyFinishContext();
4945 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4946 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4947 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4948 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4949 __Pyx_memviewslice __pyx_v_A_data_long_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4950 __Pyx_memviewslice __pyx_v_A_data_long_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4951 long double *__pyx_v_A_data_long_double;
4952 PyObject *__pyx_r = NULL;
4953 __Pyx_TraceDeclarations
4954 __Pyx_RefNannyDeclarations
4955 PyObject *__pyx_t_1 = NULL;
4956 PyObject *__pyx_t_2 = NULL;
4957 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4959 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4960 Py_ssize_t __pyx_t_6;
4961 Py_ssize_t __pyx_t_7;
4962 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4964 int __pyx_lineno = 0;
4965 const char *__pyx_filename = NULL;
4966 int __pyx_clineno = 0;
4967 __Pyx_TraceFrameInit(__pyx_codeobj__7)
4968 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double", 0);
4969 __Pyx_TraceCall(
"set_dense_matrix_long_double", __pyx_f[0], 328, 0, __PYX_ERR(0, 328, __pyx_L1_error));
4978 __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
4979 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
4980 __Pyx_GOTREF(__pyx_t_1);
4981 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
4982 __Pyx_GOTREF(__pyx_t_2);
4983 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4984 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
4985 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4986 __pyx_v_A_num_rows = __pyx_t_3;
4995 __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
4996 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
4997 __Pyx_GOTREF(__pyx_t_2);
4998 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
4999 __Pyx_GOTREF(__pyx_t_1);
5000 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5001 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
5002 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5003 __pyx_v_A_num_columns = __pyx_t_3;
5012 __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
5013 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
5014 __Pyx_GOTREF(__pyx_t_1);
5015 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5016 __Pyx_GOTREF(__pyx_t_2);
5017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5018 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
5019 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5029 __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
5030 __pyx_v_A_is_row_major = 1;
5049 __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error))
5050 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_2);
5052 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
5053 __Pyx_GOTREF(__pyx_t_1);
5054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5055 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
5056 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5057 if (likely(__pyx_t_4)) {
5066 __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
5067 __pyx_v_A_is_row_major = 0;
5086 __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
5088 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
5089 __Pyx_GOTREF(__pyx_t_1);
5090 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5092 __PYX_ERR(0, 347, __pyx_L1_error)
5103 __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
5104 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
5114 __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
5115 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 360, __pyx_L1_error)
5116 __pyx_v_A_data_long_double_mv_c = __pyx_t_5;
5117 __pyx_t_5.memview = NULL;
5118 __pyx_t_5.data = NULL;
5127 __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
5130 __pyx_v_A_data_long_double = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_A_data_long_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_long_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
5149 __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
5151 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
5152 __pyx_v_A_data_long_double_mv_f = __pyx_t_8;
5153 __pyx_t_8.memview = NULL;
5154 __pyx_t_8.data = NULL;
5163 __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error))
5166 __pyx_v_A_data_long_double = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_A_data_long_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_long_double_mv_f.strides[1]) ))));
5177 __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
5179 __pyx_t_9 =
new cDenseMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
5181 __Pyx_CppExn2PyErr();
5182 __PYX_ERR(0, 374, __pyx_L1_error)
5184 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5195 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5198 __Pyx_XDECREF(__pyx_t_1);
5199 __Pyx_XDECREF(__pyx_t_2);
5200 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5201 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5202 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5205 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_c, 1);
5206 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_f, 1);
5207 __Pyx_XGIVEREF(__pyx_r);
5208 __Pyx_TraceReturn(__pyx_r, 0);
5209 __Pyx_RefNannyFinishContext();
5222 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5223 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float[] =
"pycMatrix.set_csr_matrix_float(self, A)\n\n ";
5224 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float = {
"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float};
5225 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5226 PyObject *__pyx_r = 0;
5227 __Pyx_RefNannyDeclarations
5228 __Pyx_RefNannySetupContext(
"set_csr_matrix_float (wrapper)", 0);
5229 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5232 __Pyx_RefNannyFinishContext();
5236 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5237 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5238 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5239 __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5240 float *__pyx_v_A_data_float;
5241 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5242 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5243 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5244 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5245 PyObject *__pyx_r = NULL;
5246 __Pyx_TraceDeclarations
5247 __Pyx_RefNannyDeclarations
5248 PyObject *__pyx_t_1 = NULL;
5249 PyObject *__pyx_t_2 = NULL;
5250 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5251 PyObject *__pyx_t_4 = NULL;
5252 PyObject *__pyx_t_5 = NULL;
5253 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5254 Py_ssize_t __pyx_t_7;
5255 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5257 int __pyx_lineno = 0;
5258 const char *__pyx_filename = NULL;
5259 int __pyx_clineno = 0;
5260 __Pyx_TraceFrameInit(__pyx_codeobj__8)
5261 __Pyx_RefNannySetupContext(
"set_csr_matrix_float", 0);
5262 __Pyx_TraceCall(
"set_csr_matrix_float", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
5271 __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
5272 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
5273 __Pyx_GOTREF(__pyx_t_1);
5274 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
5275 __Pyx_GOTREF(__pyx_t_2);
5276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5277 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
5278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5279 __pyx_v_A_num_rows = __pyx_t_3;
5288 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
5289 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
5290 __Pyx_GOTREF(__pyx_t_2);
5291 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
5292 __Pyx_GOTREF(__pyx_t_1);
5293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5294 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
5295 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5296 __pyx_v_A_num_columns = __pyx_t_3;
5305 __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5306 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5307 __Pyx_GOTREF(__pyx_t_1);
5308 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
5309 __Pyx_GOTREF(__pyx_t_2);
5310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5311 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5312 __Pyx_GOTREF(__pyx_t_1);
5313 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
5314 __Pyx_GOTREF(__pyx_t_4);
5315 __Pyx_GIVEREF(__pyx_t_1);
5316 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5318 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5319 __Pyx_GOTREF(__pyx_t_1);
5320 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
5321 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
5322 __Pyx_GOTREF(__pyx_t_5);
5323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5324 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5334 __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5335 __Pyx_GIVEREF(__pyx_t_5);
5336 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5337 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5338 __pyx_v_self->A_indices_copy = __pyx_t_5;
5348 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5349 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5350 __Pyx_GOTREF(__pyx_t_5);
5351 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5352 __Pyx_GOTREF(__pyx_t_1);
5353 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5354 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5355 __Pyx_GOTREF(__pyx_t_5);
5356 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
5357 __Pyx_GOTREF(__pyx_t_4);
5358 __Pyx_GIVEREF(__pyx_t_5);
5359 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5361 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5362 __Pyx_GOTREF(__pyx_t_5);
5363 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
5364 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
5365 __Pyx_GOTREF(__pyx_t_2);
5366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5367 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5368 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5377 __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
5378 __Pyx_GIVEREF(__pyx_t_2);
5379 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5380 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5381 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5391 __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error))
5392 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
5393 __pyx_v_A_indices_mv = __pyx_t_6;
5394 __pyx_t_6.memview = NULL;
5395 __pyx_t_6.data = NULL;
5404 __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5405 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
5406 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5407 __pyx_t_6.memview = NULL;
5408 __pyx_t_6.data = NULL;
5417 __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5419 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5428 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5430 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5439 __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
5440 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
5441 __Pyx_GOTREF(__pyx_t_2);
5442 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 414, __pyx_L1_error)
5443 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5444 __pyx_v_A_data_float_mv = __pyx_t_8;
5445 __pyx_t_8.memview = NULL;
5446 __pyx_t_8.data = NULL;
5455 __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error))
5457 __pyx_v_A_data_float = (&(*((
float *) ( (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
5466 __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5468 __pyx_t_9 =
new cCSRMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5470 __Pyx_CppExn2PyErr();
5471 __PYX_ERR(0, 420, __pyx_L1_error)
5473 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
5484 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5487 __Pyx_XDECREF(__pyx_t_1);
5488 __Pyx_XDECREF(__pyx_t_2);
5489 __Pyx_XDECREF(__pyx_t_4);
5490 __Pyx_XDECREF(__pyx_t_5);
5491 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5492 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5493 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5496 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
5497 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5498 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5499 __Pyx_XGIVEREF(__pyx_r);
5500 __Pyx_TraceReturn(__pyx_r, 0);
5501 __Pyx_RefNannyFinishContext();
5514 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5515 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double[] =
"pycMatrix.set_csr_matrix_double(self, A)\n\n ";
5516 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double = {
"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double};
5517 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5518 PyObject *__pyx_r = 0;
5519 __Pyx_RefNannyDeclarations
5520 __Pyx_RefNannySetupContext(
"set_csr_matrix_double (wrapper)", 0);
5521 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5524 __Pyx_RefNannyFinishContext();
5528 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5529 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5530 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5531 __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5532 double *__pyx_v_A_data_double;
5533 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5534 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5535 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5536 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5537 PyObject *__pyx_r = NULL;
5538 __Pyx_TraceDeclarations
5539 __Pyx_RefNannyDeclarations
5540 PyObject *__pyx_t_1 = NULL;
5541 PyObject *__pyx_t_2 = NULL;
5542 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5543 PyObject *__pyx_t_4 = NULL;
5544 PyObject *__pyx_t_5 = NULL;
5545 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5546 Py_ssize_t __pyx_t_7;
5547 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5549 int __pyx_lineno = 0;
5550 const char *__pyx_filename = NULL;
5551 int __pyx_clineno = 0;
5552 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5553 __Pyx_RefNannySetupContext(
"set_csr_matrix_double", 0);
5554 __Pyx_TraceCall(
"set_csr_matrix_double", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error));
5563 __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5564 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
5565 __Pyx_GOTREF(__pyx_t_1);
5566 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
5567 __Pyx_GOTREF(__pyx_t_2);
5568 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5569 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
5570 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5571 __pyx_v_A_num_rows = __pyx_t_3;
5580 __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
5581 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
5582 __Pyx_GOTREF(__pyx_t_2);
5583 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
5584 __Pyx_GOTREF(__pyx_t_1);
5585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5586 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
5587 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5588 __pyx_v_A_num_columns = __pyx_t_3;
5597 __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5598 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5599 __Pyx_GOTREF(__pyx_t_1);
5600 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
5601 __Pyx_GOTREF(__pyx_t_2);
5602 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5603 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5604 __Pyx_GOTREF(__pyx_t_1);
5605 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
5606 __Pyx_GOTREF(__pyx_t_4);
5607 __Pyx_GIVEREF(__pyx_t_1);
5608 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5610 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5611 __Pyx_GOTREF(__pyx_t_1);
5612 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
5613 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
5614 __Pyx_GOTREF(__pyx_t_5);
5615 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5616 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5626 __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5627 __Pyx_GIVEREF(__pyx_t_5);
5628 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5629 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5630 __pyx_v_self->A_indices_copy = __pyx_t_5;
5640 __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5641 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5642 __Pyx_GOTREF(__pyx_t_5);
5643 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
5644 __Pyx_GOTREF(__pyx_t_1);
5645 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5646 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5647 __Pyx_GOTREF(__pyx_t_5);
5648 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
5649 __Pyx_GOTREF(__pyx_t_4);
5650 __Pyx_GIVEREF(__pyx_t_5);
5651 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5653 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5654 __Pyx_GOTREF(__pyx_t_5);
5655 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
5656 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
5657 __Pyx_GOTREF(__pyx_t_2);
5658 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5659 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5660 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5669 __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5670 __Pyx_GIVEREF(__pyx_t_2);
5671 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5672 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5673 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5683 __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5684 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
5685 __pyx_v_A_indices_mv = __pyx_t_6;
5686 __pyx_t_6.memview = NULL;
5687 __pyx_t_6.data = NULL;
5696 __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5697 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 454, __pyx_L1_error)
5698 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5699 __pyx_t_6.memview = NULL;
5700 __pyx_t_6.data = NULL;
5709 __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5711 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5720 __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5722 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5731 __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
5732 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
5733 __Pyx_GOTREF(__pyx_t_2);
5734 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
5735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5736 __pyx_v_A_data_double_mv = __pyx_t_8;
5737 __pyx_t_8.memview = NULL;
5738 __pyx_t_8.data = NULL;
5747 __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5749 __pyx_v_A_data_double = (&(*((
double *) ( (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
5758 __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
5760 __pyx_t_9 =
new cCSRMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5762 __Pyx_CppExn2PyErr();
5763 __PYX_ERR(0, 467, __pyx_L1_error)
5765 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
5776 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5779 __Pyx_XDECREF(__pyx_t_1);
5780 __Pyx_XDECREF(__pyx_t_2);
5781 __Pyx_XDECREF(__pyx_t_4);
5782 __Pyx_XDECREF(__pyx_t_5);
5783 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5784 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5785 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5788 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
5789 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5790 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5791 __Pyx_XGIVEREF(__pyx_r);
5792 __Pyx_TraceReturn(__pyx_r, 0);
5793 __Pyx_RefNannyFinishContext();
5806 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5807 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double[] =
"pycMatrix.set_csr_matrix_long_double(self, A)\n\n ";
5808 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double = {
"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double};
5809 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5810 PyObject *__pyx_r = 0;
5811 __Pyx_RefNannyDeclarations
5812 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double (wrapper)", 0);
5813 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5816 __Pyx_RefNannyFinishContext();
5820 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5821 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5822 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5823 __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5824 long double *__pyx_v_A_data_long_double;
5825 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5826 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5827 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5828 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5829 PyObject *__pyx_r = NULL;
5830 __Pyx_TraceDeclarations
5831 __Pyx_RefNannyDeclarations
5832 PyObject *__pyx_t_1 = NULL;
5833 PyObject *__pyx_t_2 = NULL;
5834 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5835 PyObject *__pyx_t_4 = NULL;
5836 PyObject *__pyx_t_5 = NULL;
5837 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5838 Py_ssize_t __pyx_t_7;
5839 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5841 int __pyx_lineno = 0;
5842 const char *__pyx_filename = NULL;
5843 int __pyx_clineno = 0;
5844 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5845 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double", 0);
5846 __Pyx_TraceCall(
"set_csr_matrix_long_double", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
5855 __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
5856 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
5857 __Pyx_GOTREF(__pyx_t_1);
5858 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
5859 __Pyx_GOTREF(__pyx_t_2);
5860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5861 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
5862 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5863 __pyx_v_A_num_rows = __pyx_t_3;
5872 __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error))
5873 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
5874 __Pyx_GOTREF(__pyx_t_2);
5875 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
5876 __Pyx_GOTREF(__pyx_t_1);
5877 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5878 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
5879 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5880 __pyx_v_A_num_columns = __pyx_t_3;
5889 __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error))
5890 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5891 __Pyx_GOTREF(__pyx_t_1);
5892 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
5893 __Pyx_GOTREF(__pyx_t_2);
5894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5895 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5896 __Pyx_GOTREF(__pyx_t_1);
5897 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
5898 __Pyx_GOTREF(__pyx_t_4);
5899 __Pyx_GIVEREF(__pyx_t_1);
5900 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5902 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5903 __Pyx_GOTREF(__pyx_t_1);
5904 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
5905 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
5906 __Pyx_GOTREF(__pyx_t_5);
5907 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5908 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5918 __Pyx_TraceLine(493,0,__PYX_ERR(0, 493, __pyx_L1_error))
5919 __Pyx_GIVEREF(__pyx_t_5);
5920 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5921 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5922 __pyx_v_self->A_indices_copy = __pyx_t_5;
5932 __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
5933 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5934 __Pyx_GOTREF(__pyx_t_5);
5935 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
5936 __Pyx_GOTREF(__pyx_t_1);
5937 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5938 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5939 __Pyx_GOTREF(__pyx_t_5);
5940 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
5941 __Pyx_GOTREF(__pyx_t_4);
5942 __Pyx_GIVEREF(__pyx_t_5);
5943 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5945 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5946 __Pyx_GOTREF(__pyx_t_5);
5947 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
5948 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
5949 __Pyx_GOTREF(__pyx_t_2);
5950 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5951 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5952 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5961 __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
5962 __Pyx_GIVEREF(__pyx_t_2);
5963 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5964 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5965 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5975 __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
5976 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
5977 __pyx_v_A_indices_mv = __pyx_t_6;
5978 __pyx_t_6.memview = NULL;
5979 __pyx_t_6.data = NULL;
5988 __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
5989 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
5990 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5991 __pyx_t_6.memview = NULL;
5992 __pyx_t_6.data = NULL;
6001 __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
6003 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6012 __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
6014 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6023 __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
6024 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
6025 __Pyx_GOTREF(__pyx_t_2);
6026 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
6027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6028 __pyx_v_A_data_long_double_mv = __pyx_t_8;
6029 __pyx_t_8.memview = NULL;
6030 __pyx_t_8.data = NULL;
6039 __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
6041 __pyx_v_A_data_long_double = (&(*((
long double *) ( (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6050 __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
6052 __pyx_t_9 =
new cCSRMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6054 __Pyx_CppExn2PyErr();
6055 __PYX_ERR(0, 514, __pyx_L1_error)
6057 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6068 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6071 __Pyx_XDECREF(__pyx_t_1);
6072 __Pyx_XDECREF(__pyx_t_2);
6073 __Pyx_XDECREF(__pyx_t_4);
6074 __Pyx_XDECREF(__pyx_t_5);
6075 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6076 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6077 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6080 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6081 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6082 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6083 __Pyx_XGIVEREF(__pyx_r);
6084 __Pyx_TraceReturn(__pyx_r, 0);
6085 __Pyx_RefNannyFinishContext();
6098 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6099 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float[] =
"pycMatrix.set_csc_matrix_float(self, A)\n\n ";
6100 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float = {
"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float};
6101 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6102 PyObject *__pyx_r = 0;
6103 __Pyx_RefNannyDeclarations
6104 __Pyx_RefNannySetupContext(
"set_csc_matrix_float (wrapper)", 0);
6105 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6108 __Pyx_RefNannyFinishContext();
6112 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6113 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6114 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6115 __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6116 float *__pyx_v_A_data_float;
6117 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6118 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6119 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6120 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6121 PyObject *__pyx_r = NULL;
6122 __Pyx_TraceDeclarations
6123 __Pyx_RefNannyDeclarations
6124 PyObject *__pyx_t_1 = NULL;
6125 PyObject *__pyx_t_2 = NULL;
6126 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6127 PyObject *__pyx_t_4 = NULL;
6128 PyObject *__pyx_t_5 = NULL;
6129 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6130 Py_ssize_t __pyx_t_7;
6131 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6133 int __pyx_lineno = 0;
6134 const char *__pyx_filename = NULL;
6135 int __pyx_clineno = 0;
6136 __Pyx_TraceFrameInit(__pyx_codeobj__11)
6137 __Pyx_RefNannySetupContext(
"set_csc_matrix_float", 0);
6138 __Pyx_TraceCall(
"set_csc_matrix_float", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
6147 __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
6148 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
6149 __Pyx_GOTREF(__pyx_t_1);
6150 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
6151 __Pyx_GOTREF(__pyx_t_2);
6152 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6153 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
6154 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6155 __pyx_v_A_num_rows = __pyx_t_3;
6164 __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
6165 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
6166 __Pyx_GOTREF(__pyx_t_2);
6167 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
6168 __Pyx_GOTREF(__pyx_t_1);
6169 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6170 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error)
6171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6172 __pyx_v_A_num_columns = __pyx_t_3;
6181 __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error))
6182 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6183 __Pyx_GOTREF(__pyx_t_1);
6184 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
6185 __Pyx_GOTREF(__pyx_t_2);
6186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6187 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6188 __Pyx_GOTREF(__pyx_t_1);
6189 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
6190 __Pyx_GOTREF(__pyx_t_4);
6191 __Pyx_GIVEREF(__pyx_t_1);
6192 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6194 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
6195 __Pyx_GOTREF(__pyx_t_1);
6196 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
6197 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
6198 __Pyx_GOTREF(__pyx_t_5);
6199 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6200 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6210 __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
6211 __Pyx_GIVEREF(__pyx_t_5);
6212 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6213 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6214 __pyx_v_self->A_indices_copy = __pyx_t_5;
6224 __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
6225 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6226 __Pyx_GOTREF(__pyx_t_5);
6227 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
6228 __Pyx_GOTREF(__pyx_t_1);
6229 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6230 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_5);
6232 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
6233 __Pyx_GOTREF(__pyx_t_4);
6234 __Pyx_GIVEREF(__pyx_t_5);
6235 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6237 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
6238 __Pyx_GOTREF(__pyx_t_5);
6239 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
6240 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
6241 __Pyx_GOTREF(__pyx_t_2);
6242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6253 __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error))
6254 __Pyx_GIVEREF(__pyx_t_2);
6255 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6256 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6257 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6267 __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
6268 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
6269 __pyx_v_A_indices_mv = __pyx_t_6;
6270 __pyx_t_6.memview = NULL;
6271 __pyx_t_6.data = NULL;
6280 __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error))
6281 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 548, __pyx_L1_error)
6282 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6283 __pyx_t_6.memview = NULL;
6284 __pyx_t_6.data = NULL;
6293 __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
6295 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6304 __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
6306 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6315 __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error))
6316 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
6317 __Pyx_GOTREF(__pyx_t_2);
6318 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
6319 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6320 __pyx_v_A_data_float_mv = __pyx_t_8;
6321 __pyx_t_8.memview = NULL;
6322 __pyx_t_8.data = NULL;
6331 __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6333 __pyx_v_A_data_float = (&(*((
float *) ( (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
6342 __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6344 __pyx_t_9 =
new cCSCMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6346 __Pyx_CppExn2PyErr();
6347 __PYX_ERR(0, 561, __pyx_L1_error)
6349 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
6360 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6363 __Pyx_XDECREF(__pyx_t_1);
6364 __Pyx_XDECREF(__pyx_t_2);
6365 __Pyx_XDECREF(__pyx_t_4);
6366 __Pyx_XDECREF(__pyx_t_5);
6367 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6368 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6369 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6372 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
6373 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6374 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6375 __Pyx_XGIVEREF(__pyx_r);
6376 __Pyx_TraceReturn(__pyx_r, 0);
6377 __Pyx_RefNannyFinishContext();
6390 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6391 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double[] =
"pycMatrix.set_csc_matrix_double(self, A)\n\n ";
6392 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double = {
"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double};
6393 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6394 PyObject *__pyx_r = 0;
6395 __Pyx_RefNannyDeclarations
6396 __Pyx_RefNannySetupContext(
"set_csc_matrix_double (wrapper)", 0);
6397 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6400 __Pyx_RefNannyFinishContext();
6404 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6405 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6406 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6407 __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6408 double *__pyx_v_A_data_double;
6409 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6410 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6411 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6412 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6413 PyObject *__pyx_r = NULL;
6414 __Pyx_TraceDeclarations
6415 __Pyx_RefNannyDeclarations
6416 PyObject *__pyx_t_1 = NULL;
6417 PyObject *__pyx_t_2 = NULL;
6418 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6419 PyObject *__pyx_t_4 = NULL;
6420 PyObject *__pyx_t_5 = NULL;
6421 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6422 Py_ssize_t __pyx_t_7;
6423 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6425 int __pyx_lineno = 0;
6426 const char *__pyx_filename = NULL;
6427 int __pyx_clineno = 0;
6428 __Pyx_TraceFrameInit(__pyx_codeobj__12)
6429 __Pyx_RefNannySetupContext(
"set_csc_matrix_double", 0);
6430 __Pyx_TraceCall(
"set_csc_matrix_double", __pyx_f[0], 572, 0, __PYX_ERR(0, 572, __pyx_L1_error));
6439 __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error))
6440 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
6441 __Pyx_GOTREF(__pyx_t_1);
6442 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
6443 __Pyx_GOTREF(__pyx_t_2);
6444 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6445 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
6446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6447 __pyx_v_A_num_rows = __pyx_t_3;
6456 __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
6457 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
6458 __Pyx_GOTREF(__pyx_t_2);
6459 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
6460 __Pyx_GOTREF(__pyx_t_1);
6461 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6462 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
6463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6464 __pyx_v_A_num_columns = __pyx_t_3;
6473 __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6474 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6475 __Pyx_GOTREF(__pyx_t_1);
6476 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
6477 __Pyx_GOTREF(__pyx_t_2);
6478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6479 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6480 __Pyx_GOTREF(__pyx_t_1);
6481 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
6482 __Pyx_GOTREF(__pyx_t_4);
6483 __Pyx_GIVEREF(__pyx_t_1);
6484 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6486 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6487 __Pyx_GOTREF(__pyx_t_1);
6488 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
6489 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
6490 __Pyx_GOTREF(__pyx_t_5);
6491 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6492 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6502 __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L1_error))
6503 __Pyx_GIVEREF(__pyx_t_5);
6504 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6505 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6506 __pyx_v_self->A_indices_copy = __pyx_t_5;
6516 __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error))
6517 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6518 __Pyx_GOTREF(__pyx_t_5);
6519 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
6520 __Pyx_GOTREF(__pyx_t_1);
6521 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6522 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6523 __Pyx_GOTREF(__pyx_t_5);
6524 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
6525 __Pyx_GOTREF(__pyx_t_4);
6526 __Pyx_GIVEREF(__pyx_t_5);
6527 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6529 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6530 __Pyx_GOTREF(__pyx_t_5);
6531 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
6532 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
6533 __Pyx_GOTREF(__pyx_t_2);
6534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6535 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6536 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6545 __Pyx_TraceLine(589,0,__PYX_ERR(0, 589, __pyx_L1_error))
6546 __Pyx_GIVEREF(__pyx_t_2);
6547 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6548 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6549 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6559 __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
6560 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 593, __pyx_L1_error)
6561 __pyx_v_A_indices_mv = __pyx_t_6;
6562 __pyx_t_6.memview = NULL;
6563 __pyx_t_6.data = NULL;
6572 __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
6573 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 595, __pyx_L1_error)
6574 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6575 __pyx_t_6.memview = NULL;
6576 __pyx_t_6.data = NULL;
6585 __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
6587 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6596 __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
6598 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6607 __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
6608 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
6609 __Pyx_GOTREF(__pyx_t_2);
6610 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
6611 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6612 __pyx_v_A_data_double_mv = __pyx_t_8;
6613 __pyx_t_8.memview = NULL;
6614 __pyx_t_8.data = NULL;
6623 __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
6625 __pyx_v_A_data_double = (&(*((
double *) ( (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
6634 __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error))
6636 __pyx_t_9 =
new cCSCMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6638 __Pyx_CppExn2PyErr();
6639 __PYX_ERR(0, 608, __pyx_L1_error)
6641 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
6652 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6655 __Pyx_XDECREF(__pyx_t_1);
6656 __Pyx_XDECREF(__pyx_t_2);
6657 __Pyx_XDECREF(__pyx_t_4);
6658 __Pyx_XDECREF(__pyx_t_5);
6659 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6660 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6661 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6664 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
6665 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6666 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6667 __Pyx_XGIVEREF(__pyx_r);
6668 __Pyx_TraceReturn(__pyx_r, 0);
6669 __Pyx_RefNannyFinishContext();
6682 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6683 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double[] =
"pycMatrix.set_csc_matrix_long_double(self, A)\n\n ";
6684 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double = {
"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double};
6685 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6686 PyObject *__pyx_r = 0;
6687 __Pyx_RefNannyDeclarations
6688 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double (wrapper)", 0);
6689 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6692 __Pyx_RefNannyFinishContext();
6696 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6697 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6698 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6699 __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6700 long double *__pyx_v_A_data_long_double;
6701 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6702 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6703 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6704 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6705 PyObject *__pyx_r = NULL;
6706 __Pyx_TraceDeclarations
6707 __Pyx_RefNannyDeclarations
6708 PyObject *__pyx_t_1 = NULL;
6709 PyObject *__pyx_t_2 = NULL;
6710 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6711 PyObject *__pyx_t_4 = NULL;
6712 PyObject *__pyx_t_5 = NULL;
6713 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6714 Py_ssize_t __pyx_t_7;
6715 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6717 int __pyx_lineno = 0;
6718 const char *__pyx_filename = NULL;
6719 int __pyx_clineno = 0;
6720 __Pyx_TraceFrameInit(__pyx_codeobj__13)
6721 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double", 0);
6722 __Pyx_TraceCall(
"set_csc_matrix_long_double", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error));
6731 __Pyx_TraceLine(624,0,__PYX_ERR(0, 624, __pyx_L1_error))
6732 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
6733 __Pyx_GOTREF(__pyx_t_1);
6734 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
6735 __Pyx_GOTREF(__pyx_t_2);
6736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6737 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error)
6738 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6739 __pyx_v_A_num_rows = __pyx_t_3;
6748 __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
6749 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
6750 __Pyx_GOTREF(__pyx_t_2);
6751 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
6752 __Pyx_GOTREF(__pyx_t_1);
6753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6754 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
6755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6756 __pyx_v_A_num_columns = __pyx_t_3;
6765 __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
6766 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6767 __Pyx_GOTREF(__pyx_t_1);
6768 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
6769 __Pyx_GOTREF(__pyx_t_2);
6770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6771 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6772 __Pyx_GOTREF(__pyx_t_1);
6773 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
6774 __Pyx_GOTREF(__pyx_t_4);
6775 __Pyx_GIVEREF(__pyx_t_1);
6776 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6778 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6779 __Pyx_GOTREF(__pyx_t_1);
6780 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
6781 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
6782 __Pyx_GOTREF(__pyx_t_5);
6783 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6785 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6794 __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
6795 __Pyx_GIVEREF(__pyx_t_5);
6796 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6797 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6798 __pyx_v_self->A_indices_copy = __pyx_t_5;
6808 __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
6809 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6810 __Pyx_GOTREF(__pyx_t_5);
6811 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
6812 __Pyx_GOTREF(__pyx_t_1);
6813 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6814 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6815 __Pyx_GOTREF(__pyx_t_5);
6816 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
6817 __Pyx_GOTREF(__pyx_t_4);
6818 __Pyx_GIVEREF(__pyx_t_5);
6819 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6821 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6822 __Pyx_GOTREF(__pyx_t_5);
6823 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
6824 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
6825 __Pyx_GOTREF(__pyx_t_2);
6826 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6827 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6828 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6837 __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error))
6838 __Pyx_GIVEREF(__pyx_t_2);
6839 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6840 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6841 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6851 __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
6852 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 640, __pyx_L1_error)
6853 __pyx_v_A_indices_mv = __pyx_t_6;
6854 __pyx_t_6.memview = NULL;
6855 __pyx_t_6.data = NULL;
6864 __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
6865 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
6866 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6867 __pyx_t_6.memview = NULL;
6868 __pyx_t_6.data = NULL;
6877 __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
6879 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6888 __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
6890 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6899 __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
6900 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
6901 __Pyx_GOTREF(__pyx_t_2);
6902 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 649, __pyx_L1_error)
6903 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6904 __pyx_v_A_data_long_double_mv = __pyx_t_8;
6905 __pyx_t_8.memview = NULL;
6906 __pyx_t_8.data = NULL;
6915 __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
6917 __pyx_v_A_data_long_double = (&(*((
long double *) ( (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6926 __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
6928 __pyx_t_9 =
new cCSCMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6930 __Pyx_CppExn2PyErr();
6931 __PYX_ERR(0, 655, __pyx_L1_error)
6933 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6944 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6947 __Pyx_XDECREF(__pyx_t_1);
6948 __Pyx_XDECREF(__pyx_t_2);
6949 __Pyx_XDECREF(__pyx_t_4);
6950 __Pyx_XDECREF(__pyx_t_5);
6951 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6952 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6953 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6956 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6957 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6958 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6959 __Pyx_XGIVEREF(__pyx_r);
6960 __Pyx_TraceReturn(__pyx_r, 0);
6961 __Pyx_RefNannyFinishContext();
6972 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6973 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__[] =
"pycMatrix.__reduce_cython__(self)";
6974 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__};
6975 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6976 PyObject *__pyx_r = 0;
6977 __Pyx_RefNannyDeclarations
6978 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6979 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self));
6982 __Pyx_RefNannyFinishContext();
6986 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self) {
6987 PyObject *__pyx_r = NULL;
6988 __Pyx_TraceDeclarations
6989 __Pyx_RefNannyDeclarations
6990 PyObject *__pyx_t_1 = NULL;
6991 int __pyx_lineno = 0;
6992 const char *__pyx_filename = NULL;
6993 int __pyx_clineno = 0;
6994 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6995 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6996 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
7004 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
7005 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
7006 __Pyx_GOTREF(__pyx_t_1);
7007 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7008 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7009 __PYX_ERR(1, 2, __pyx_L1_error)
7019 __Pyx_XDECREF(__pyx_t_1);
7020 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7022 __Pyx_XGIVEREF(__pyx_r);
7023 __Pyx_TraceReturn(__pyx_r, 0);
7024 __Pyx_RefNannyFinishContext();
7036 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
7037 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__[] =
"pycMatrix.__setstate_cython__(self, __pyx_state)";
7038 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__};
7039 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7040 PyObject *__pyx_r = 0;
7041 __Pyx_RefNannyDeclarations
7042 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
7043 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7046 __Pyx_RefNannyFinishContext();
7050 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7051 PyObject *__pyx_r = NULL;
7052 __Pyx_TraceDeclarations
7053 __Pyx_RefNannyDeclarations
7054 PyObject *__pyx_t_1 = NULL;
7055 int __pyx_lineno = 0;
7056 const char *__pyx_filename = NULL;
7057 int __pyx_clineno = 0;
7058 __Pyx_TraceFrameInit(__pyx_codeobj__16)
7059 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
7060 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
7067 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
7068 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
7069 __Pyx_GOTREF(__pyx_t_1);
7070 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7071 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7072 __PYX_ERR(1, 4, __pyx_L1_error)
7083 __Pyx_XDECREF(__pyx_t_1);
7084 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7086 __Pyx_XGIVEREF(__pyx_r);
7087 __Pyx_TraceReturn(__pyx_r, 0);
7088 __Pyx_RefNannyFinishContext();
7101 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7102 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7103 PyObject *__pyx_v_shape = 0;
7104 Py_ssize_t __pyx_v_itemsize;
7105 PyObject *__pyx_v_format = 0;
7106 PyObject *__pyx_v_mode = 0;
7107 int __pyx_v_allocate_buffer;
7108 int __pyx_lineno = 0;
7109 const char *__pyx_filename = NULL;
7110 int __pyx_clineno = 0;
7112 __Pyx_RefNannyDeclarations
7113 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
7115 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7116 PyObject* values[5] = {0,0,0,0,0};
7117 values[3] = ((PyObject *)__pyx_n_s_c);
7118 if (unlikely(__pyx_kwds)) {
7120 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7122 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7124 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7126 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7128 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7130 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7133 default:
goto __pyx_L5_argtuple_error;
7135 kw_args = PyDict_Size(__pyx_kwds);
7138 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7139 else goto __pyx_L5_argtuple_error;
7142 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7144 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
7148 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7150 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
7155 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7156 if (value) { values[3] = value; kw_args--; }
7161 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7162 if (value) { values[4] = value; kw_args--; }
7165 if (unlikely(kw_args > 0)) {
7166 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
7169 switch (PyTuple_GET_SIZE(__pyx_args)) {
7170 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7172 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7174 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7175 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7176 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7178 default:
goto __pyx_L5_argtuple_error;
7181 __pyx_v_shape = ((PyObject*)values[0]);
7182 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7183 __pyx_v_format = values[2];
7184 __pyx_v_mode = values[3];
7186 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
7196 __pyx_v_allocate_buffer = ((int)1);
7199 goto __pyx_L4_argument_unpacking_done;
7200 __pyx_L5_argtuple_error:;
7201 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
7203 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7204 __Pyx_RefNannyFinishContext();
7206 __pyx_L4_argument_unpacking_done:;
7207 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
7208 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7209 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 123, __pyx_L1_error)
7211 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7226 __Pyx_RefNannyFinishContext();
7230 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
7232 Py_ssize_t __pyx_v_i;
7233 Py_ssize_t __pyx_v_dim;
7234 PyObject **__pyx_v_p;
7237 __Pyx_TraceDeclarations
7238 __Pyx_RefNannyDeclarations
7239 Py_ssize_t __pyx_t_1;
7241 PyObject *__pyx_t_3 = NULL;
7243 PyObject *__pyx_t_5 = NULL;
7244 PyObject *__pyx_t_6 = NULL;
7247 Py_ssize_t __pyx_t_9;
7248 PyObject *__pyx_t_10 = NULL;
7249 Py_ssize_t __pyx_t_11;
7250 int __pyx_lineno = 0;
7251 const char *__pyx_filename = NULL;
7252 int __pyx_clineno = 0;
7253 __Pyx_RefNannySetupContext(
"__cinit__", 0);
7254 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
7255 __Pyx_INCREF(__pyx_v_format);
7264 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
7265 if (unlikely(__pyx_v_shape == Py_None)) {
7266 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
7267 __PYX_ERR(1, 130, __pyx_L1_error)
7269 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
7270 __pyx_v_self->ndim = ((int)__pyx_t_1);
7279 __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
7280 __pyx_v_self->itemsize = __pyx_v_itemsize;
7289 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
7290 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7291 if (unlikely(__pyx_t_2)) {
7300 __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
7301 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
7302 __Pyx_GOTREF(__pyx_t_3);
7303 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7304 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7305 __PYX_ERR(1, 134, __pyx_L1_error)
7323 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
7324 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7325 if (unlikely(__pyx_t_2)) {
7334 __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
7335 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
7336 __Pyx_GOTREF(__pyx_t_3);
7337 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7338 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7339 __PYX_ERR(1, 137, __pyx_L1_error)
7357 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
7358 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7359 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7369 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
7370 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
7371 __Pyx_GOTREF(__pyx_t_5);
7373 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7374 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7375 if (likely(__pyx_t_6)) {
7376 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7377 __Pyx_INCREF(__pyx_t_6);
7378 __Pyx_INCREF(
function);
7379 __Pyx_DECREF_SET(__pyx_t_5,
function);
7382 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7383 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7384 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
7385 __Pyx_GOTREF(__pyx_t_3);
7386 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7387 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7406 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
7407 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
7408 __pyx_t_3 = __pyx_v_format;
7409 __Pyx_INCREF(__pyx_t_3);
7410 __Pyx_GIVEREF(__pyx_t_3);
7411 __Pyx_GOTREF(__pyx_v_self->_format);
7412 __Pyx_DECREF(__pyx_v_self->_format);
7413 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7423 __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
7424 if (unlikely(__pyx_v_self->_format == Py_None)) {
7425 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
7426 __PYX_ERR(1, 142, __pyx_L1_error)
7428 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
7429 __pyx_v_self->format = __pyx_t_7;
7438 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
7439 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7448 __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
7449 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7458 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
7459 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7460 if (unlikely(__pyx_t_4)) {
7469 __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
7470 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
7471 __Pyx_GOTREF(__pyx_t_3);
7472 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7473 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7474 __PYX_ERR(1, 149, __pyx_L1_error)
7492 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7494 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7496 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
7497 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7498 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
7500 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
7501 __Pyx_GOTREF(__pyx_t_5);
7503 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
7504 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7505 __pyx_v_dim = __pyx_t_9;
7506 __pyx_v_idx = __pyx_t_8;
7507 __pyx_t_8 = (__pyx_t_8 + 1);
7516 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
7517 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7518 if (unlikely(__pyx_t_4)) {
7527 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
7528 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
7529 __Pyx_GOTREF(__pyx_t_5);
7530 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7531 __Pyx_GOTREF(__pyx_t_6);
7532 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7533 __Pyx_GOTREF(__pyx_t_10);
7534 __Pyx_GIVEREF(__pyx_t_5);
7535 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7536 __Pyx_GIVEREF(__pyx_t_6);
7537 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7540 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
7541 __Pyx_GOTREF(__pyx_t_6);
7542 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7543 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
7544 __Pyx_GOTREF(__pyx_t_10);
7545 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7546 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7547 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7548 __PYX_ERR(1, 154, __pyx_L1_error)
7566 __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
7567 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7576 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7578 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7587 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
7588 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
7598 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
7599 __pyx_v_order =
'F';
7608 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
7609 __Pyx_INCREF(__pyx_n_u_fortran);
7610 __Pyx_GIVEREF(__pyx_n_u_fortran);
7611 __Pyx_GOTREF(__pyx_v_self->mode);
7612 __Pyx_DECREF(__pyx_v_self->mode);
7613 __pyx_v_self->mode = __pyx_n_u_fortran;
7632 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
7633 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
7634 if (likely(__pyx_t_4)) {
7643 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
7644 __pyx_v_order =
'C';
7653 __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
7654 __Pyx_INCREF(__pyx_n_u_c);
7655 __Pyx_GIVEREF(__pyx_n_u_c);
7656 __Pyx_GOTREF(__pyx_v_self->mode);
7657 __Pyx_DECREF(__pyx_v_self->mode);
7658 __pyx_v_self->mode = __pyx_n_u_c;
7677 __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
7679 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
7680 __Pyx_GOTREF(__pyx_t_3);
7681 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
7682 __Pyx_GOTREF(__pyx_t_10);
7683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7684 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7685 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7686 __PYX_ERR(1, 165, __pyx_L1_error)
7697 __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
7698 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7707 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7708 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7717 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7718 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
7719 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
7720 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7721 __pyx_v_self->dtype_is_object = __pyx_t_4;
7730 __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
7731 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7741 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7742 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
7751 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7752 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7753 if (unlikely(__pyx_t_4)) {
7762 __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
7763 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
7764 __Pyx_GOTREF(__pyx_t_10);
7765 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7766 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7767 __PYX_ERR(1, 177, __pyx_L1_error)
7785 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7786 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7796 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7797 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7806 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7807 if (unlikely(__pyx_v_itemsize == 0)) {
7808 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
7809 __PYX_ERR(1, 181, __pyx_L1_error)
7811 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7812 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
7813 __PYX_ERR(1, 181, __pyx_L1_error)
7815 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7816 __pyx_t_9 = __pyx_t_1;
7817 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7818 __pyx_v_i = __pyx_t_11;
7827 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7828 (__pyx_v_p[__pyx_v_i]) = Py_None;
7837 __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
7871 __Pyx_XDECREF(__pyx_t_3);
7872 __Pyx_XDECREF(__pyx_t_5);
7873 __Pyx_XDECREF(__pyx_t_6);
7874 __Pyx_XDECREF(__pyx_t_10);
7875 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7878 __Pyx_XDECREF(__pyx_v_format);
7879 __Pyx_TraceReturn(Py_None, 0);
7880 __Pyx_RefNannyFinishContext();
7893 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7894 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7896 __Pyx_RefNannyDeclarations
7897 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7898 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7901 __Pyx_RefNannyFinishContext();
7905 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7906 int __pyx_v_bufmode;
7908 __Pyx_TraceDeclarations
7909 __Pyx_RefNannyDeclarations
7912 PyObject *__pyx_t_3 = NULL;
7914 Py_ssize_t __pyx_t_5;
7916 Py_ssize_t *__pyx_t_7;
7917 int __pyx_lineno = 0;
7918 const char *__pyx_filename = NULL;
7919 int __pyx_clineno = 0;
7920 if (__pyx_v_info == NULL) {
7921 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7924 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7925 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7926 __Pyx_GIVEREF(__pyx_v_info->obj);
7927 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
7936 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7937 __pyx_v_bufmode = -1;
7946 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7947 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
7948 __pyx_t_2 = (__pyx_t_1 != 0);
7958 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7959 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7978 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7979 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
7980 __pyx_t_1 = (__pyx_t_2 != 0);
7990 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7991 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8010 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
8011 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8012 if (unlikely(__pyx_t_1)) {
8021 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
8022 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
8023 __Pyx_GOTREF(__pyx_t_3);
8024 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8025 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8026 __PYX_ERR(1, 193, __pyx_L1_error)
8044 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
8045 __pyx_t_4 = __pyx_v_self->data;
8046 __pyx_v_info->buf = __pyx_t_4;
8055 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
8056 __pyx_t_5 = __pyx_v_self->len;
8057 __pyx_v_info->len = __pyx_t_5;
8066 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
8067 __pyx_t_6 = __pyx_v_self->ndim;
8068 __pyx_v_info->ndim = __pyx_t_6;
8077 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
8078 __pyx_t_7 = __pyx_v_self->_shape;
8079 __pyx_v_info->shape = __pyx_t_7;
8088 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
8089 __pyx_t_7 = __pyx_v_self->_strides;
8090 __pyx_v_info->strides = __pyx_t_7;
8099 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
8100 __pyx_v_info->suboffsets = NULL;
8109 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
8110 __pyx_t_5 = __pyx_v_self->itemsize;
8111 __pyx_v_info->itemsize = __pyx_t_5;
8120 __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
8121 __pyx_v_info->readonly = 0;
8130 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
8131 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8141 __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
8142 __pyx_t_4 = __pyx_v_self->format;
8143 __pyx_v_info->format = __pyx_t_4;
8162 __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
8164 __pyx_v_info->format = NULL;
8175 __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
8176 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8177 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8178 __Pyx_GOTREF(__pyx_v_info->obj);
8179 __Pyx_DECREF(__pyx_v_info->obj);
8180 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8194 __Pyx_XDECREF(__pyx_t_3);
8195 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8197 if (__pyx_v_info->obj != NULL) {
8198 __Pyx_GOTREF(__pyx_v_info->obj);
8199 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8203 if (__pyx_v_info->obj == Py_None) {
8204 __Pyx_GOTREF(__pyx_v_info->obj);
8205 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8208 __Pyx_TraceReturn(Py_None, 0);
8209 __Pyx_RefNannyFinishContext();
8222 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
8223 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8224 __Pyx_RefNannyDeclarations
8225 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
8226 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
8229 __Pyx_RefNannyFinishContext();
8232 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
8233 __Pyx_TraceDeclarations
8234 __Pyx_RefNannyDeclarations
8236 int __pyx_lineno = 0;
8237 const char *__pyx_filename = NULL;
8238 int __pyx_clineno = 0;
8239 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
8240 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
8249 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
8250 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8260 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
8261 __pyx_v_self->callback_free_data(__pyx_v_self->data);
8280 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
8281 __pyx_t_1 = (__pyx_v_self->free_data != 0);
8291 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
8292 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8302 __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
8303 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8321 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
8322 free(__pyx_v_self->data);
8341 __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
8342 PyObject_Free(__pyx_v_self->_shape);
8355 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8357 __Pyx_TraceReturn(Py_None, 0);
8358 __Pyx_RefNannyFinishContext();
8370 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
8371 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8372 PyObject *__pyx_r = 0;
8373 __Pyx_RefNannyDeclarations
8374 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
8375 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
8378 __Pyx_RefNannyFinishContext();
8382 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
8383 PyObject *__pyx_r = NULL;
8384 __Pyx_TraceDeclarations
8385 __Pyx_RefNannyDeclarations
8386 PyObject *__pyx_t_1 = NULL;
8387 int __pyx_lineno = 0;
8388 const char *__pyx_filename = NULL;
8389 int __pyx_clineno = 0;
8390 __Pyx_RefNannySetupContext(
"__get__", 0);
8391 __Pyx_TraceCall(
"__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
8400 __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
8401 __Pyx_XDECREF(__pyx_r);
8402 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
8403 __Pyx_GOTREF(__pyx_t_1);
8404 __pyx_r = __pyx_t_1;
8418 __Pyx_XDECREF(__pyx_t_1);
8419 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8422 __Pyx_XGIVEREF(__pyx_r);
8423 __Pyx_TraceReturn(__pyx_r, 0);
8424 __Pyx_RefNannyFinishContext();
8436 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
8438 PyObject *__pyx_r = NULL;
8439 __Pyx_TraceDeclarations
8440 __Pyx_RefNannyDeclarations
8441 PyObject *__pyx_t_1 = NULL;
8442 PyObject *__pyx_t_2 = NULL;
8443 PyObject *__pyx_t_3 = NULL;
8444 int __pyx_lineno = 0;
8445 const char *__pyx_filename = NULL;
8446 int __pyx_clineno = 0;
8447 __Pyx_RefNannySetupContext(
"get_memview", 0);
8448 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
8457 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
8458 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8467 __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
8468 __Pyx_XDECREF(__pyx_r);
8469 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
8470 __Pyx_GOTREF(__pyx_t_1);
8471 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8472 __Pyx_GOTREF(__pyx_t_2);
8473 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
8474 __Pyx_GOTREF(__pyx_t_3);
8475 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8476 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8477 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8478 __Pyx_GIVEREF(__pyx_t_1);
8479 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8480 __Pyx_GIVEREF(__pyx_t_2);
8481 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8484 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
8485 __Pyx_GOTREF(__pyx_t_2);
8486 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8487 __pyx_r = __pyx_t_2;
8501 __Pyx_XDECREF(__pyx_t_1);
8502 __Pyx_XDECREF(__pyx_t_2);
8503 __Pyx_XDECREF(__pyx_t_3);
8504 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8507 __Pyx_XGIVEREF(__pyx_r);
8508 __Pyx_TraceReturn(__pyx_r, 0);
8509 __Pyx_RefNannyFinishContext();
8522 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
8523 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8525 __Pyx_RefNannyDeclarations
8526 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
8527 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
8530 __Pyx_RefNannyFinishContext();
8534 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
8536 __Pyx_TraceDeclarations
8537 __Pyx_RefNannyDeclarations
8538 int __pyx_lineno = 0;
8539 const char *__pyx_filename = NULL;
8540 int __pyx_clineno = 0;
8541 __Pyx_RefNannySetupContext(
"__len__", 0);
8542 __Pyx_TraceCall(
"__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
8551 __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
8552 __pyx_r = (__pyx_v_self->_shape[0]);
8565 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8568 __Pyx_TraceReturn(Py_None, 0);
8569 __Pyx_RefNannyFinishContext();
8582 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
8583 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8584 PyObject *__pyx_r = 0;
8585 __Pyx_RefNannyDeclarations
8586 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
8587 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8590 __Pyx_RefNannyFinishContext();
8594 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8595 PyObject *__pyx_r = NULL;
8596 __Pyx_TraceDeclarations
8597 __Pyx_RefNannyDeclarations
8598 PyObject *__pyx_t_1 = NULL;
8599 PyObject *__pyx_t_2 = NULL;
8600 int __pyx_lineno = 0;
8601 const char *__pyx_filename = NULL;
8602 int __pyx_clineno = 0;
8603 __Pyx_RefNannySetupContext(
"__getattr__", 0);
8604 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
8613 __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
8614 __Pyx_XDECREF(__pyx_r);
8615 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
8616 __Pyx_GOTREF(__pyx_t_1);
8617 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
8618 __Pyx_GOTREF(__pyx_t_2);
8619 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8620 __pyx_r = __pyx_t_2;
8634 __Pyx_XDECREF(__pyx_t_1);
8635 __Pyx_XDECREF(__pyx_t_2);
8636 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8639 __Pyx_XGIVEREF(__pyx_r);
8640 __Pyx_TraceReturn(__pyx_r, 0);
8641 __Pyx_RefNannyFinishContext();
8654 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
8655 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8656 PyObject *__pyx_r = 0;
8657 __Pyx_RefNannyDeclarations
8658 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8659 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8662 __Pyx_RefNannyFinishContext();
8666 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8667 PyObject *__pyx_r = NULL;
8668 __Pyx_TraceDeclarations
8669 __Pyx_RefNannyDeclarations
8670 PyObject *__pyx_t_1 = NULL;
8671 PyObject *__pyx_t_2 = NULL;
8672 int __pyx_lineno = 0;
8673 const char *__pyx_filename = NULL;
8674 int __pyx_clineno = 0;
8675 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8676 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
8685 __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
8686 __Pyx_XDECREF(__pyx_r);
8687 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
8688 __Pyx_GOTREF(__pyx_t_1);
8689 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
8690 __Pyx_GOTREF(__pyx_t_2);
8691 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8692 __pyx_r = __pyx_t_2;
8706 __Pyx_XDECREF(__pyx_t_1);
8707 __Pyx_XDECREF(__pyx_t_2);
8708 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8711 __Pyx_XGIVEREF(__pyx_r);
8712 __Pyx_TraceReturn(__pyx_r, 0);
8713 __Pyx_RefNannyFinishContext();
8726 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
8727 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8729 __Pyx_RefNannyDeclarations
8730 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8731 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8734 __Pyx_RefNannyFinishContext();
8738 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8740 __Pyx_TraceDeclarations
8741 __Pyx_RefNannyDeclarations
8742 PyObject *__pyx_t_1 = NULL;
8743 int __pyx_lineno = 0;
8744 const char *__pyx_filename = NULL;
8745 int __pyx_clineno = 0;
8746 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8747 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
8756 __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
8757 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
8758 __Pyx_GOTREF(__pyx_t_1);
8759 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
8760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8774 __Pyx_XDECREF(__pyx_t_1);
8775 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8778 __Pyx_TraceReturn(Py_None, 0);
8779 __Pyx_RefNannyFinishContext();
8790 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8791 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8792 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8793 PyObject *__pyx_r = 0;
8794 __Pyx_RefNannyDeclarations
8795 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8796 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
8799 __Pyx_RefNannyFinishContext();
8803 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
8804 PyObject *__pyx_r = NULL;
8805 __Pyx_TraceDeclarations
8806 __Pyx_RefNannyDeclarations
8807 PyObject *__pyx_t_1 = NULL;
8808 int __pyx_lineno = 0;
8809 const char *__pyx_filename = NULL;
8810 int __pyx_clineno = 0;
8811 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8812 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8820 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8821 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8822 __Pyx_GOTREF(__pyx_t_1);
8823 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8825 __PYX_ERR(1, 2, __pyx_L1_error)
8835 __Pyx_XDECREF(__pyx_t_1);
8836 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8838 __Pyx_XGIVEREF(__pyx_r);
8839 __Pyx_TraceReturn(__pyx_r, 0);
8840 __Pyx_RefNannyFinishContext();
8852 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8853 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8854 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8855 PyObject *__pyx_r = 0;
8856 __Pyx_RefNannyDeclarations
8857 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8858 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8861 __Pyx_RefNannyFinishContext();
8865 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8866 PyObject *__pyx_r = NULL;
8867 __Pyx_TraceDeclarations
8868 __Pyx_RefNannyDeclarations
8869 PyObject *__pyx_t_1 = NULL;
8870 int __pyx_lineno = 0;
8871 const char *__pyx_filename = NULL;
8872 int __pyx_clineno = 0;
8873 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8874 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8881 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8882 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8883 __Pyx_GOTREF(__pyx_t_1);
8884 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8886 __PYX_ERR(1, 4, __pyx_L1_error)
8897 __Pyx_XDECREF(__pyx_t_1);
8898 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8900 __Pyx_XGIVEREF(__pyx_r);
8901 __Pyx_TraceReturn(__pyx_r, 0);
8902 __Pyx_RefNannyFinishContext();
8914 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
8915 struct __pyx_array_obj *__pyx_v_result = 0;
8916 struct __pyx_array_obj *__pyx_r = NULL;
8917 __Pyx_TraceDeclarations
8918 __Pyx_RefNannyDeclarations
8920 PyObject *__pyx_t_2 = NULL;
8921 PyObject *__pyx_t_3 = NULL;
8922 PyObject *__pyx_t_4 = NULL;
8923 PyObject *__pyx_t_5 = NULL;
8924 int __pyx_lineno = 0;
8925 const char *__pyx_filename = NULL;
8926 int __pyx_clineno = 0;
8927 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
8928 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
8937 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8938 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8948 __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
8949 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
8950 __Pyx_GOTREF(__pyx_t_2);
8951 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
8952 __Pyx_GOTREF(__pyx_t_3);
8953 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8954 __Pyx_GOTREF(__pyx_t_4);
8955 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
8956 __Pyx_GOTREF(__pyx_t_5);
8957 __Pyx_INCREF(__pyx_v_shape);
8958 __Pyx_GIVEREF(__pyx_v_shape);
8959 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8960 __Pyx_GIVEREF(__pyx_t_2);
8961 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8962 __Pyx_GIVEREF(__pyx_t_3);
8963 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8964 __Pyx_GIVEREF(__pyx_t_4);
8965 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8969 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8970 __Pyx_GOTREF(__pyx_t_4);
8971 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8972 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8992 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8994 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
8995 __Pyx_GOTREF(__pyx_t_4);
8996 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8997 __Pyx_GOTREF(__pyx_t_5);
8998 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8999 __Pyx_GOTREF(__pyx_t_3);
9000 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
9001 __Pyx_GOTREF(__pyx_t_2);
9002 __Pyx_INCREF(__pyx_v_shape);
9003 __Pyx_GIVEREF(__pyx_v_shape);
9004 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9005 __Pyx_GIVEREF(__pyx_t_4);
9006 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9007 __Pyx_GIVEREF(__pyx_t_5);
9008 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9009 __Pyx_GIVEREF(__pyx_t_3);
9010 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9022 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
9023 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
9024 __Pyx_GOTREF(__pyx_t_3);
9025 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
9034 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
9035 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
9036 __Pyx_GOTREF(__pyx_t_5);
9037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9038 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9039 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9049 __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
9050 __pyx_v_result->data = __pyx_v_buf;
9061 __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
9062 __Pyx_XDECREF(((PyObject *)__pyx_r));
9063 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9064 __pyx_r = __pyx_v_result;
9077 __Pyx_XDECREF(__pyx_t_2);
9078 __Pyx_XDECREF(__pyx_t_3);
9079 __Pyx_XDECREF(__pyx_t_4);
9080 __Pyx_XDECREF(__pyx_t_5);
9081 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9084 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9085 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9086 __Pyx_TraceReturn(__pyx_r, 0);
9087 __Pyx_RefNannyFinishContext();
9100 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9101 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9102 PyObject *__pyx_v_name = 0;
9103 int __pyx_lineno = 0;
9104 const char *__pyx_filename = NULL;
9105 int __pyx_clineno = 0;
9107 __Pyx_RefNannyDeclarations
9108 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9110 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9111 PyObject* values[1] = {0};
9112 if (unlikely(__pyx_kwds)) {
9114 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9116 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9119 default:
goto __pyx_L5_argtuple_error;
9121 kw_args = PyDict_Size(__pyx_kwds);
9124 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9125 else goto __pyx_L5_argtuple_error;
9127 if (unlikely(kw_args > 0)) {
9128 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
9130 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9131 goto __pyx_L5_argtuple_error;
9133 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9135 __pyx_v_name = values[0];
9137 goto __pyx_L4_argument_unpacking_done;
9138 __pyx_L5_argtuple_error:;
9139 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
9141 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9142 __Pyx_RefNannyFinishContext();
9144 __pyx_L4_argument_unpacking_done:;
9145 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9148 __Pyx_RefNannyFinishContext();
9152 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9154 __Pyx_TraceDeclarations
9155 __Pyx_RefNannyDeclarations
9156 int __pyx_lineno = 0;
9157 const char *__pyx_filename = NULL;
9158 int __pyx_clineno = 0;
9159 __Pyx_RefNannySetupContext(
"__init__", 0);
9160 __Pyx_TraceCall(
"__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
9169 __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
9170 __Pyx_INCREF(__pyx_v_name);
9171 __Pyx_GIVEREF(__pyx_v_name);
9172 __Pyx_GOTREF(__pyx_v_self->name);
9173 __Pyx_DECREF(__pyx_v_self->name);
9174 __pyx_v_self->name = __pyx_v_name;
9188 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9191 __Pyx_TraceReturn(Py_None, 0);
9192 __Pyx_RefNannyFinishContext();
9205 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
9206 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9207 PyObject *__pyx_r = 0;
9208 __Pyx_RefNannyDeclarations
9209 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
9210 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9213 __Pyx_RefNannyFinishContext();
9217 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9218 PyObject *__pyx_r = NULL;
9219 __Pyx_TraceDeclarations
9220 __Pyx_RefNannyDeclarations
9221 int __pyx_lineno = 0;
9222 const char *__pyx_filename = NULL;
9223 int __pyx_clineno = 0;
9224 __Pyx_RefNannySetupContext(
"__repr__", 0);
9225 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
9234 __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
9235 __Pyx_XDECREF(__pyx_r);
9236 __Pyx_INCREF(__pyx_v_self->name);
9237 __pyx_r = __pyx_v_self->name;
9250 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9253 __Pyx_XGIVEREF(__pyx_r);
9254 __Pyx_TraceReturn(__pyx_r, 0);
9255 __Pyx_RefNannyFinishContext();
9266 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9267 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9268 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9269 PyObject *__pyx_r = 0;
9270 __Pyx_RefNannyDeclarations
9271 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9272 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9275 __Pyx_RefNannyFinishContext();
9279 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9280 PyObject *__pyx_v_state = 0;
9281 PyObject *__pyx_v__dict = 0;
9282 int __pyx_v_use_setstate;
9283 PyObject *__pyx_r = NULL;
9284 __Pyx_TraceDeclarations
9285 __Pyx_RefNannyDeclarations
9286 PyObject *__pyx_t_1 = NULL;
9289 PyObject *__pyx_t_4 = NULL;
9290 PyObject *__pyx_t_5 = NULL;
9291 int __pyx_lineno = 0;
9292 const char *__pyx_filename = NULL;
9293 int __pyx_clineno = 0;
9294 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9295 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9304 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
9305 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9306 __Pyx_GOTREF(__pyx_t_1);
9307 __Pyx_INCREF(__pyx_v_self->name);
9308 __Pyx_GIVEREF(__pyx_v_self->name);
9309 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9310 __pyx_v_state = ((PyObject*)__pyx_t_1);
9320 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
9321 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9322 __Pyx_GOTREF(__pyx_t_1);
9323 __pyx_v__dict = __pyx_t_1;
9333 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
9334 __pyx_t_2 = (__pyx_v__dict != Py_None);
9335 __pyx_t_3 = (__pyx_t_2 != 0);
9345 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
9346 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9347 __Pyx_GOTREF(__pyx_t_1);
9348 __Pyx_INCREF(__pyx_v__dict);
9349 __Pyx_GIVEREF(__pyx_v__dict);
9350 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9351 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9352 __Pyx_GOTREF(__pyx_t_4);
9353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9354 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9364 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
9365 __pyx_v_use_setstate = 1;
9384 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
9386 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9387 __pyx_v_use_setstate = __pyx_t_3;
9398 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
9399 __pyx_t_3 = (__pyx_v_use_setstate != 0);
9409 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
9410 __Pyx_XDECREF(__pyx_r);
9411 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9412 __Pyx_GOTREF(__pyx_t_4);
9413 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9414 __Pyx_GOTREF(__pyx_t_1);
9415 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9416 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9417 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9418 __Pyx_INCREF(__pyx_int_184977713);
9419 __Pyx_GIVEREF(__pyx_int_184977713);
9420 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9421 __Pyx_INCREF(Py_None);
9422 __Pyx_GIVEREF(Py_None);
9423 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9424 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9425 __Pyx_GOTREF(__pyx_t_5);
9426 __Pyx_GIVEREF(__pyx_t_4);
9427 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9428 __Pyx_GIVEREF(__pyx_t_1);
9429 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9430 __Pyx_INCREF(__pyx_v_state);
9431 __Pyx_GIVEREF(__pyx_v_state);
9432 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9435 __pyx_r = __pyx_t_5;
9455 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
9457 __Pyx_XDECREF(__pyx_r);
9458 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9459 __Pyx_GOTREF(__pyx_t_5);
9460 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9461 __Pyx_GOTREF(__pyx_t_1);
9462 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9463 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9464 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9465 __Pyx_INCREF(__pyx_int_184977713);
9466 __Pyx_GIVEREF(__pyx_int_184977713);
9467 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9468 __Pyx_INCREF(__pyx_v_state);
9469 __Pyx_GIVEREF(__pyx_v_state);
9470 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9471 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9472 __Pyx_GOTREF(__pyx_t_4);
9473 __Pyx_GIVEREF(__pyx_t_5);
9474 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9475 __Pyx_GIVEREF(__pyx_t_1);
9476 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9479 __pyx_r = __pyx_t_4;
9492 __Pyx_XDECREF(__pyx_t_1);
9493 __Pyx_XDECREF(__pyx_t_4);
9494 __Pyx_XDECREF(__pyx_t_5);
9495 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9498 __Pyx_XDECREF(__pyx_v_state);
9499 __Pyx_XDECREF(__pyx_v__dict);
9500 __Pyx_XGIVEREF(__pyx_r);
9501 __Pyx_TraceReturn(__pyx_r, 0);
9502 __Pyx_RefNannyFinishContext();
9514 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9515 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9516 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9517 PyObject *__pyx_r = 0;
9518 __Pyx_RefNannyDeclarations
9519 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9520 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9523 __Pyx_RefNannyFinishContext();
9527 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9528 PyObject *__pyx_r = NULL;
9529 __Pyx_TraceDeclarations
9530 __Pyx_RefNannyDeclarations
9531 PyObject *__pyx_t_1 = NULL;
9532 int __pyx_lineno = 0;
9533 const char *__pyx_filename = NULL;
9534 int __pyx_clineno = 0;
9535 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9536 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
9543 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
9544 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9545 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9546 __Pyx_GOTREF(__pyx_t_1);
9547 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9557 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9560 __Pyx_XDECREF(__pyx_t_1);
9561 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9564 __Pyx_XGIVEREF(__pyx_r);
9565 __Pyx_TraceReturn(__pyx_r, 0);
9566 __Pyx_RefNannyFinishContext();
9578 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
9579 Py_intptr_t __pyx_v_aligned_p;
9580 size_t __pyx_v_offset;
9582 __Pyx_TraceDeclarations
9584 int __pyx_lineno = 0;
9585 const char *__pyx_filename = NULL;
9586 int __pyx_clineno = 0;
9587 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
9596 __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
9597 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9606 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9615 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
9616 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9626 __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
9627 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9645 __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
9646 __pyx_r = ((
void *)__pyx_v_aligned_p);
9659 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
9662 __Pyx_TraceReturn(Py_None, 1);
9675 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9676 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9677 PyObject *__pyx_v_obj = 0;
9679 int __pyx_v_dtype_is_object;
9680 int __pyx_lineno = 0;
9681 const char *__pyx_filename = NULL;
9682 int __pyx_clineno = 0;
9684 __Pyx_RefNannyDeclarations
9685 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9687 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9688 PyObject* values[3] = {0,0,0};
9689 if (unlikely(__pyx_kwds)) {
9691 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9693 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9695 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9697 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9700 default:
goto __pyx_L5_argtuple_error;
9702 kw_args = PyDict_Size(__pyx_kwds);
9705 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9706 else goto __pyx_L5_argtuple_error;
9709 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9711 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
9716 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9717 if (value) { values[2] = value; kw_args--; }
9720 if (unlikely(kw_args > 0)) {
9721 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
9724 switch (PyTuple_GET_SIZE(__pyx_args)) {
9725 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9727 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9728 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9730 default:
goto __pyx_L5_argtuple_error;
9733 __pyx_v_obj = values[0];
9734 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9736 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
9738 __pyx_v_dtype_is_object = ((int)0);
9741 goto __pyx_L4_argument_unpacking_done;
9742 __pyx_L5_argtuple_error:;
9743 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
9745 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9746 __Pyx_RefNannyFinishContext();
9748 __pyx_L4_argument_unpacking_done:;
9749 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9752 __Pyx_RefNannyFinishContext();
9756 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
9758 __Pyx_TraceDeclarations
9759 __Pyx_RefNannyDeclarations
9764 int __pyx_lineno = 0;
9765 const char *__pyx_filename = NULL;
9766 int __pyx_clineno = 0;
9767 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9768 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
9777 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9778 __Pyx_INCREF(__pyx_v_obj);
9779 __Pyx_GIVEREF(__pyx_v_obj);
9780 __Pyx_GOTREF(__pyx_v_self->obj);
9781 __Pyx_DECREF(__pyx_v_self->obj);
9782 __pyx_v_self->obj = __pyx_v_obj;
9791 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9792 __pyx_v_self->flags = __pyx_v_flags;
9801 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9802 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9803 __pyx_t_3 = (__pyx_t_2 != 0);
9806 __pyx_t_1 = __pyx_t_3;
9807 goto __pyx_L4_bool_binop_done;
9809 __pyx_t_3 = (__pyx_v_obj != Py_None);
9810 __pyx_t_2 = (__pyx_t_3 != 0);
9811 __pyx_t_1 = __pyx_t_2;
9812 __pyx_L4_bool_binop_done:;
9822 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9823 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
9832 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9833 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9843 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9844 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9853 __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
9881 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9882 __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
9892 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9893 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9903 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9904 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9913 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9914 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9932 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9933 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9943 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9944 __pyx_v_self->lock = PyThread_allocate_lock();
9953 __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
9954 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9955 if (unlikely(__pyx_t_1)) {
9964 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9965 PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
10001 __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
10002 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10012 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
10013 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10016 __pyx_t_1 = __pyx_t_2;
10017 goto __pyx_L12_bool_binop_done;
10019 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10020 __pyx_t_1 = __pyx_t_2;
10021 __pyx_L12_bool_binop_done:;
10022 __pyx_v_self->dtype_is_object = __pyx_t_1;
10041 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
10043 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10054 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
10055 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
10064 __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
10065 __pyx_v_self->typeinfo = NULL;
10079 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10082 __Pyx_TraceReturn(Py_None, 0);
10083 __Pyx_RefNannyFinishContext();
10096 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10097 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10098 __Pyx_RefNannyDeclarations
10099 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10100 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10103 __Pyx_RefNannyFinishContext();
10106 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10108 __Pyx_TraceDeclarations
10109 __Pyx_RefNannyDeclarations
10115 PyThread_type_lock __pyx_t_6;
10116 PyThread_type_lock __pyx_t_7;
10117 int __pyx_lineno = 0;
10118 const char *__pyx_filename = NULL;
10119 int __pyx_clineno = 0;
10120 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10121 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
10130 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
10131 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10132 __pyx_t_2 = (__pyx_t_1 != 0);
10142 __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
10143 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10162 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
10163 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10173 __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
10174 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10183 __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
10184 Py_DECREF(Py_None);
10203 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
10204 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10214 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
10215 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10216 __pyx_t_4 = __pyx_t_3;
10217 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10218 __pyx_v_i = __pyx_t_5;
10227 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
10228 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10238 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
10239 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10248 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
10249 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10259 __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
10260 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10261 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10270 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
10271 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10272 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10290 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
10291 goto __pyx_L6_break;
10311 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
10312 PyThread_free_lock(__pyx_v_self->lock);
10336 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10338 __Pyx_TraceReturn(Py_None, 0);
10339 __Pyx_RefNannyFinishContext();
10350 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10351 Py_ssize_t __pyx_v_dim;
10352 char *__pyx_v_itemp;
10353 PyObject *__pyx_v_idx = NULL;
10355 __Pyx_TraceDeclarations
10356 __Pyx_RefNannyDeclarations
10357 Py_ssize_t __pyx_t_1;
10358 PyObject *__pyx_t_2 = NULL;
10359 Py_ssize_t __pyx_t_3;
10360 PyObject *(*__pyx_t_4)(PyObject *);
10361 PyObject *__pyx_t_5 = NULL;
10362 Py_ssize_t __pyx_t_6;
10364 int __pyx_lineno = 0;
10365 const char *__pyx_filename = NULL;
10366 int __pyx_clineno = 0;
10367 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10368 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
10377 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10378 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10387 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10389 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10390 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10393 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
10394 __Pyx_GOTREF(__pyx_t_2);
10395 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
10398 if (likely(!__pyx_t_4)) {
10399 if (likely(PyList_CheckExact(__pyx_t_2))) {
10400 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10401 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10402 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10404 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10405 __Pyx_GOTREF(__pyx_t_5);
10408 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10409 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10410 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
10412 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
10413 __Pyx_GOTREF(__pyx_t_5);
10417 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10418 if (unlikely(!__pyx_t_5)) {
10419 PyObject* exc_type = PyErr_Occurred();
10421 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10422 else __PYX_ERR(1, 399, __pyx_L1_error)
10426 __Pyx_GOTREF(__pyx_t_5);
10428 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10430 __pyx_v_dim = __pyx_t_1;
10431 __pyx_t_1 = (__pyx_t_1 + 1);
10440 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
10441 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
10442 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
10443 __pyx_v_itemp = __pyx_t_7;
10452 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
10454 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10463 __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
10464 __pyx_r = __pyx_v_itemp;
10477 __Pyx_XDECREF(__pyx_t_2);
10478 __Pyx_XDECREF(__pyx_t_5);
10479 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10482 __Pyx_XDECREF(__pyx_v_idx);
10483 __Pyx_TraceReturn(Py_None, 0);
10484 __Pyx_RefNannyFinishContext();
10497 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
10498 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10499 PyObject *__pyx_r = 0;
10500 __Pyx_RefNannyDeclarations
10501 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10502 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10505 __Pyx_RefNannyFinishContext();
10509 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10510 PyObject *__pyx_v_have_slices = NULL;
10511 PyObject *__pyx_v_indices = NULL;
10512 char *__pyx_v_itemp;
10513 PyObject *__pyx_r = NULL;
10514 __Pyx_TraceDeclarations
10515 __Pyx_RefNannyDeclarations
10518 PyObject *__pyx_t_3 = NULL;
10519 PyObject *__pyx_t_4 = NULL;
10520 PyObject *__pyx_t_5 = NULL;
10522 int __pyx_lineno = 0;
10523 const char *__pyx_filename = NULL;
10524 int __pyx_clineno = 0;
10525 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10526 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
10535 __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
10536 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10537 __pyx_t_2 = (__pyx_t_1 != 0);
10547 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
10548 __Pyx_XDECREF(__pyx_r);
10549 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10550 __pyx_r = ((PyObject *)__pyx_v_self);
10569 __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
10570 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
10571 __Pyx_GOTREF(__pyx_t_3);
10572 if (likely(__pyx_t_3 != Py_None)) {
10573 PyObject* sequence = __pyx_t_3;
10574 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10575 if (unlikely(size != 2)) {
10576 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10577 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10578 __PYX_ERR(1, 409, __pyx_L1_error)
10580 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10581 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10582 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10583 __Pyx_INCREF(__pyx_t_4);
10584 __Pyx_INCREF(__pyx_t_5);
10586 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
10587 __Pyx_GOTREF(__pyx_t_4);
10588 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
10589 __Pyx_GOTREF(__pyx_t_5);
10591 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10593 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
10595 __pyx_v_have_slices = __pyx_t_4;
10597 __pyx_v_indices = __pyx_t_5;
10607 __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
10608 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
10618 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
10619 __Pyx_XDECREF(__pyx_r);
10620 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
10621 __Pyx_GOTREF(__pyx_t_3);
10622 __pyx_r = __pyx_t_3;
10642 __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
10644 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
10645 __pyx_v_itemp = __pyx_t_6;
10654 __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
10655 __Pyx_XDECREF(__pyx_r);
10656 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
10657 __Pyx_GOTREF(__pyx_t_3);
10658 __pyx_r = __pyx_t_3;
10673 __Pyx_XDECREF(__pyx_t_3);
10674 __Pyx_XDECREF(__pyx_t_4);
10675 __Pyx_XDECREF(__pyx_t_5);
10676 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10679 __Pyx_XDECREF(__pyx_v_have_slices);
10680 __Pyx_XDECREF(__pyx_v_indices);
10681 __Pyx_XGIVEREF(__pyx_r);
10682 __Pyx_TraceReturn(__pyx_r, 0);
10683 __Pyx_RefNannyFinishContext();
10696 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
10697 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10699 __Pyx_RefNannyDeclarations
10700 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10701 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10704 __Pyx_RefNannyFinishContext();
10708 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10709 PyObject *__pyx_v_have_slices = NULL;
10710 PyObject *__pyx_v_obj = NULL;
10712 __Pyx_TraceDeclarations
10713 __Pyx_RefNannyDeclarations
10715 PyObject *__pyx_t_2 = NULL;
10716 PyObject *__pyx_t_3 = NULL;
10717 PyObject *__pyx_t_4 = NULL;
10718 int __pyx_lineno = 0;
10719 const char *__pyx_filename = NULL;
10720 int __pyx_clineno = 0;
10721 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10722 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
10723 __Pyx_INCREF(__pyx_v_index);
10732 __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
10733 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10734 if (unlikely(__pyx_t_1)) {
10743 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10744 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10745 __Pyx_GOTREF(__pyx_t_2);
10746 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10748 __PYX_ERR(1, 420, __pyx_L1_error)
10766 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10767 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_2);
10769 if (likely(__pyx_t_2 != Py_None)) {
10770 PyObject* sequence = __pyx_t_2;
10771 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10772 if (unlikely(size != 2)) {
10773 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10774 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10775 __PYX_ERR(1, 422, __pyx_L1_error)
10777 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10778 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10779 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10780 __Pyx_INCREF(__pyx_t_3);
10781 __Pyx_INCREF(__pyx_t_4);
10783 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
10784 __Pyx_GOTREF(__pyx_t_3);
10785 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
10786 __Pyx_GOTREF(__pyx_t_4);
10788 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10790 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
10792 __pyx_v_have_slices = __pyx_t_3;
10794 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10804 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10805 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10815 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10816 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10817 __Pyx_GOTREF(__pyx_t_2);
10818 __pyx_v_obj = __pyx_t_2;
10828 __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
10829 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
10839 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10840 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10841 __Pyx_GOTREF(__pyx_t_2);
10842 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10843 __Pyx_GOTREF(__pyx_t_4);
10844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10845 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10864 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10866 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
10867 __Pyx_GOTREF(__pyx_t_4);
10868 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
10869 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10870 __Pyx_GOTREF(__pyx_t_2);
10871 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10893 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
10895 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
10896 __Pyx_GOTREF(__pyx_t_2);
10897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10913 __Pyx_XDECREF(__pyx_t_2);
10914 __Pyx_XDECREF(__pyx_t_3);
10915 __Pyx_XDECREF(__pyx_t_4);
10916 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10919 __Pyx_XDECREF(__pyx_v_have_slices);
10920 __Pyx_XDECREF(__pyx_v_obj);
10921 __Pyx_XDECREF(__pyx_v_index);
10922 __Pyx_TraceReturn(Py_None, 0);
10923 __Pyx_RefNannyFinishContext();
10935 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10936 PyObject *__pyx_r = NULL;
10937 __Pyx_TraceDeclarations
10938 __Pyx_RefNannyDeclarations
10941 PyObject *__pyx_t_3 = NULL;
10942 PyObject *__pyx_t_4 = NULL;
10943 PyObject *__pyx_t_5 = NULL;
10944 PyObject *__pyx_t_6 = NULL;
10945 PyObject *__pyx_t_7 = NULL;
10946 PyObject *__pyx_t_8 = NULL;
10948 int __pyx_lineno = 0;
10949 const char *__pyx_filename = NULL;
10950 int __pyx_clineno = 0;
10951 __Pyx_RefNannySetupContext(
"is_slice", 0);
10952 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
10953 __Pyx_INCREF(__pyx_v_obj);
10962 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
10963 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10964 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10974 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
10976 __Pyx_PyThreadState_declare
10977 __Pyx_PyThreadState_assign
10978 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10979 __Pyx_XGOTREF(__pyx_t_3);
10980 __Pyx_XGOTREF(__pyx_t_4);
10981 __Pyx_XGOTREF(__pyx_t_5);
10991 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10992 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
10993 __Pyx_GOTREF(__pyx_t_6);
11002 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
11003 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
11004 __Pyx_GOTREF(__pyx_t_7);
11013 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
11014 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
11015 __Pyx_GOTREF(__pyx_t_8);
11016 __Pyx_INCREF(__pyx_v_obj);
11017 __Pyx_GIVEREF(__pyx_v_obj);
11018 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11019 __Pyx_GIVEREF(__pyx_t_6);
11020 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11021 __Pyx_GIVEREF(__pyx_t_7);
11022 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11025 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
11026 __Pyx_GOTREF(__pyx_t_7);
11027 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11028 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11039 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11040 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11041 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11042 goto __pyx_L9_try_end;
11044 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11045 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11046 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11055 __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
11056 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11058 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11059 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
11060 __Pyx_GOTREF(__pyx_t_7);
11061 __Pyx_GOTREF(__pyx_t_8);
11062 __Pyx_GOTREF(__pyx_t_6);
11071 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
11072 __Pyx_XDECREF(__pyx_r);
11073 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11074 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11075 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11076 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11077 goto __pyx_L7_except_return;
11079 goto __pyx_L6_except_error;
11080 __pyx_L6_except_error:;
11089 __Pyx_XGIVEREF(__pyx_t_3);
11090 __Pyx_XGIVEREF(__pyx_t_4);
11091 __Pyx_XGIVEREF(__pyx_t_5);
11092 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11093 goto __pyx_L1_error;
11094 __pyx_L7_except_return:;
11095 __Pyx_XGIVEREF(__pyx_t_3);
11096 __Pyx_XGIVEREF(__pyx_t_4);
11097 __Pyx_XGIVEREF(__pyx_t_5);
11098 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11119 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
11120 __Pyx_XDECREF(__pyx_r);
11121 __Pyx_INCREF(__pyx_v_obj);
11122 __pyx_r = __pyx_v_obj;
11135 __Pyx_XDECREF(__pyx_t_6);
11136 __Pyx_XDECREF(__pyx_t_7);
11137 __Pyx_XDECREF(__pyx_t_8);
11138 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11141 __Pyx_XDECREF(__pyx_v_obj);
11142 __Pyx_XGIVEREF(__pyx_r);
11143 __Pyx_TraceReturn(__pyx_r, 0);
11144 __Pyx_RefNannyFinishContext();
11156 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11157 __Pyx_memviewslice __pyx_v_dst_slice;
11158 __Pyx_memviewslice __pyx_v_src_slice;
11159 PyObject *__pyx_r = NULL;
11160 __Pyx_TraceDeclarations
11161 __Pyx_RefNannyDeclarations
11162 __Pyx_memviewslice *__pyx_t_1;
11163 __Pyx_memviewslice *__pyx_t_2;
11164 PyObject *__pyx_t_3 = NULL;
11168 int __pyx_lineno = 0;
11169 const char *__pyx_filename = NULL;
11170 int __pyx_clineno = 0;
11171 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11172 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
11181 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11182 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
11183 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
11192 __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
11193 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
11194 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
11203 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
11204 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11205 __Pyx_GOTREF(__pyx_t_3);
11206 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11207 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11208 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
11209 __Pyx_GOTREF(__pyx_t_3);
11210 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
11211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11220 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
11221 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
11232 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11235 __Pyx_XDECREF(__pyx_t_3);
11236 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11239 __Pyx_XGIVEREF(__pyx_r);
11240 __Pyx_TraceReturn(__pyx_r, 0);
11241 __Pyx_RefNannyFinishContext();
11253 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11254 int __pyx_v_array[0x80];
11256 void *__pyx_v_item;
11257 __Pyx_memviewslice *__pyx_v_dst_slice;
11258 __Pyx_memviewslice __pyx_v_tmp_slice;
11259 PyObject *__pyx_r = NULL;
11260 __Pyx_TraceDeclarations
11261 __Pyx_RefNannyDeclarations
11262 __Pyx_memviewslice *__pyx_t_1;
11264 PyObject *__pyx_t_3 = NULL;
11267 char const *__pyx_t_6;
11268 PyObject *__pyx_t_7 = NULL;
11269 PyObject *__pyx_t_8 = NULL;
11270 PyObject *__pyx_t_9 = NULL;
11271 PyObject *__pyx_t_10 = NULL;
11272 PyObject *__pyx_t_11 = NULL;
11273 PyObject *__pyx_t_12 = NULL;
11274 int __pyx_lineno = 0;
11275 const char *__pyx_filename = NULL;
11276 int __pyx_clineno = 0;
11277 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11278 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
11287 __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
11288 __pyx_v_tmp = NULL;
11297 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
11298 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
11299 __pyx_v_dst_slice = __pyx_t_1;
11308 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
11309 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11319 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
11320 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11329 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
11330 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11331 if (unlikely(__pyx_t_2)) {
11340 __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
11341 PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
11359 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
11360 __pyx_v_item = __pyx_v_tmp;
11379 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
11381 __pyx_v_item = ((
void *)__pyx_v_array);
11392 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
11402 __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
11403 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11413 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
11414 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11433 __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
11435 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
11436 __Pyx_GOTREF(__pyx_t_3);
11437 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11448 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
11449 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11459 __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
11460 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
11461 __Pyx_GOTREF(__pyx_t_3);
11462 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11480 __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
11481 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11491 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
11494 PyMem_Free(__pyx_v_tmp);
11499 __Pyx_PyThreadState_declare
11500 __Pyx_PyThreadState_assign
11501 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11502 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11503 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11504 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11505 __Pyx_XGOTREF(__pyx_t_7);
11506 __Pyx_XGOTREF(__pyx_t_8);
11507 __Pyx_XGOTREF(__pyx_t_9);
11508 __Pyx_XGOTREF(__pyx_t_10);
11509 __Pyx_XGOTREF(__pyx_t_11);
11510 __Pyx_XGOTREF(__pyx_t_12);
11511 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11513 PyMem_Free(__pyx_v_tmp);
11515 if (PY_MAJOR_VERSION >= 3) {
11516 __Pyx_XGIVEREF(__pyx_t_10);
11517 __Pyx_XGIVEREF(__pyx_t_11);
11518 __Pyx_XGIVEREF(__pyx_t_12);
11519 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11521 __Pyx_XGIVEREF(__pyx_t_7);
11522 __Pyx_XGIVEREF(__pyx_t_8);
11523 __Pyx_XGIVEREF(__pyx_t_9);
11524 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11525 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11526 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11527 goto __pyx_L1_error;
11541 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11544 __Pyx_XDECREF(__pyx_t_3);
11545 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11548 __Pyx_XGIVEREF(__pyx_r);
11549 __Pyx_TraceReturn(__pyx_r, 0);
11550 __Pyx_RefNannyFinishContext();
11562 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11563 char *__pyx_v_itemp;
11564 PyObject *__pyx_r = NULL;
11565 __Pyx_TraceDeclarations
11566 __Pyx_RefNannyDeclarations
11568 PyObject *__pyx_t_2 = NULL;
11569 int __pyx_lineno = 0;
11570 const char *__pyx_filename = NULL;
11571 int __pyx_clineno = 0;
11572 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
11573 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
11582 __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
11583 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
11584 __pyx_v_itemp = __pyx_t_1;
11593 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
11594 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
11595 __Pyx_GOTREF(__pyx_t_2);
11596 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11607 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11610 __Pyx_XDECREF(__pyx_t_2);
11611 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11614 __Pyx_XGIVEREF(__pyx_r);
11615 __Pyx_TraceReturn(__pyx_r, 0);
11616 __Pyx_RefNannyFinishContext();
11628 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
11629 PyObject *__pyx_v_struct = NULL;
11630 PyObject *__pyx_v_bytesitem = 0;
11631 PyObject *__pyx_v_result = NULL;
11632 PyObject *__pyx_r = NULL;
11633 __Pyx_TraceDeclarations
11634 __Pyx_RefNannyDeclarations
11635 PyObject *__pyx_t_1 = NULL;
11636 PyObject *__pyx_t_2 = NULL;
11637 PyObject *__pyx_t_3 = NULL;
11638 PyObject *__pyx_t_4 = NULL;
11639 PyObject *__pyx_t_5 = NULL;
11640 PyObject *__pyx_t_6 = NULL;
11641 PyObject *__pyx_t_7 = NULL;
11643 PyObject *__pyx_t_9 = NULL;
11646 int __pyx_lineno = 0;
11647 const char *__pyx_filename = NULL;
11648 int __pyx_clineno = 0;
11649 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
11650 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
11659 __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
11660 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
11661 __Pyx_GOTREF(__pyx_t_1);
11662 __pyx_v_struct = __pyx_t_1;
11672 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
11673 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
11674 __Pyx_GOTREF(__pyx_t_1);
11675 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11685 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
11687 __Pyx_PyThreadState_declare
11688 __Pyx_PyThreadState_assign
11689 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11690 __Pyx_XGOTREF(__pyx_t_2);
11691 __Pyx_XGOTREF(__pyx_t_3);
11692 __Pyx_XGOTREF(__pyx_t_4);
11702 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
11703 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
11704 __Pyx_GOTREF(__pyx_t_5);
11705 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
11706 __Pyx_GOTREF(__pyx_t_6);
11709 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11710 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11711 if (likely(__pyx_t_7)) {
11712 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11713 __Pyx_INCREF(__pyx_t_7);
11714 __Pyx_INCREF(
function);
11715 __Pyx_DECREF_SET(__pyx_t_5,
function);
11719 #if CYTHON_FAST_PYCALL
11720 if (PyFunction_Check(__pyx_t_5)) {
11721 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11722 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11723 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11724 __Pyx_GOTREF(__pyx_t_1);
11725 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11728 #if CYTHON_FAST_PYCCALL
11729 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11730 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11731 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11732 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11733 __Pyx_GOTREF(__pyx_t_1);
11734 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11738 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
11739 __Pyx_GOTREF(__pyx_t_9);
11741 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11743 __Pyx_GIVEREF(__pyx_t_6);
11744 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11745 __Pyx_INCREF(__pyx_v_bytesitem);
11746 __Pyx_GIVEREF(__pyx_v_bytesitem);
11747 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11749 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
11750 __Pyx_GOTREF(__pyx_t_1);
11751 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11753 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11754 __pyx_v_result = __pyx_t_1;
11773 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11775 __pyx_t_10 = strlen(__pyx_v_self->view.format);
11776 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11786 __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
11787 __Pyx_XDECREF(__pyx_r);
11788 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
11789 __Pyx_GOTREF(__pyx_t_1);
11790 __pyx_r = __pyx_t_1;
11792 goto __pyx_L6_except_return;
11810 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
11811 __Pyx_XDECREF(__pyx_r);
11812 __Pyx_INCREF(__pyx_v_result);
11813 __pyx_r = __pyx_v_result;
11814 goto __pyx_L6_except_return;
11817 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11818 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11819 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11820 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11821 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11830 __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
11831 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11832 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
11833 __Pyx_GOTREF(__pyx_t_6);
11834 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11835 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11836 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11837 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11839 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11840 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
11841 __Pyx_GOTREF(__pyx_t_9);
11842 __Pyx_GOTREF(__pyx_t_5);
11843 __Pyx_GOTREF(__pyx_t_1);
11852 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11853 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
11854 __Pyx_GOTREF(__pyx_t_6);
11855 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11856 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11857 __PYX_ERR(1, 497, __pyx_L5_except_error)
11859 goto __pyx_L5_except_error;
11860 __pyx_L5_except_error:;
11869 __Pyx_XGIVEREF(__pyx_t_2);
11870 __Pyx_XGIVEREF(__pyx_t_3);
11871 __Pyx_XGIVEREF(__pyx_t_4);
11872 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11873 goto __pyx_L1_error;
11874 __pyx_L6_except_return:;
11875 __Pyx_XGIVEREF(__pyx_t_2);
11876 __Pyx_XGIVEREF(__pyx_t_3);
11877 __Pyx_XGIVEREF(__pyx_t_4);
11878 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11892 __Pyx_XDECREF(__pyx_t_1);
11893 __Pyx_XDECREF(__pyx_t_5);
11894 __Pyx_XDECREF(__pyx_t_6);
11895 __Pyx_XDECREF(__pyx_t_7);
11896 __Pyx_XDECREF(__pyx_t_9);
11897 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11900 __Pyx_XDECREF(__pyx_v_struct);
11901 __Pyx_XDECREF(__pyx_v_bytesitem);
11902 __Pyx_XDECREF(__pyx_v_result);
11903 __Pyx_XGIVEREF(__pyx_r);
11904 __Pyx_TraceReturn(__pyx_r, 0);
11905 __Pyx_RefNannyFinishContext();
11917 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11918 PyObject *__pyx_v_struct = NULL;
11920 PyObject *__pyx_v_bytesvalue = 0;
11921 Py_ssize_t __pyx_v_i;
11922 PyObject *__pyx_r = NULL;
11923 __Pyx_TraceDeclarations
11924 __Pyx_RefNannyDeclarations
11925 PyObject *__pyx_t_1 = NULL;
11928 PyObject *__pyx_t_4 = NULL;
11929 PyObject *__pyx_t_5 = NULL;
11930 PyObject *__pyx_t_6 = NULL;
11932 PyObject *__pyx_t_8 = NULL;
11933 Py_ssize_t __pyx_t_9;
11934 PyObject *__pyx_t_10 = NULL;
11939 int __pyx_lineno = 0;
11940 const char *__pyx_filename = NULL;
11941 int __pyx_clineno = 0;
11942 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
11943 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
11952 __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
11953 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
11954 __Pyx_GOTREF(__pyx_t_1);
11955 __pyx_v_struct = __pyx_t_1;
11965 __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
11966 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11967 __pyx_t_3 = (__pyx_t_2 != 0);
11977 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11978 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11979 __Pyx_GOTREF(__pyx_t_1);
11980 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11981 __Pyx_GOTREF(__pyx_t_4);
11982 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
11983 __Pyx_GOTREF(__pyx_t_5);
11984 __Pyx_GIVEREF(__pyx_t_4);
11985 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11987 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11988 __Pyx_GOTREF(__pyx_t_4);
11989 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11990 __Pyx_GOTREF(__pyx_t_6);
11991 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11992 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11993 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11994 __Pyx_GOTREF(__pyx_t_4);
11995 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11996 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11997 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11998 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12018 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
12020 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
12021 __Pyx_GOTREF(__pyx_t_6);
12022 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
12023 __Pyx_GOTREF(__pyx_t_1);
12026 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12027 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12028 if (likely(__pyx_t_5)) {
12029 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12030 __Pyx_INCREF(__pyx_t_5);
12031 __Pyx_INCREF(
function);
12032 __Pyx_DECREF_SET(__pyx_t_6,
function);
12036 #if CYTHON_FAST_PYCALL
12037 if (PyFunction_Check(__pyx_t_6)) {
12038 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12039 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
12040 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12041 __Pyx_GOTREF(__pyx_t_4);
12042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12045 #if CYTHON_FAST_PYCCALL
12046 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12047 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12048 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
12049 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12050 __Pyx_GOTREF(__pyx_t_4);
12051 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12055 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
12056 __Pyx_GOTREF(__pyx_t_8);
12058 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12060 __Pyx_GIVEREF(__pyx_t_1);
12061 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12062 __Pyx_INCREF(__pyx_v_value);
12063 __Pyx_GIVEREF(__pyx_v_value);
12064 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12066 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
12067 __Pyx_GOTREF(__pyx_t_4);
12068 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12070 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12071 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
12072 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12084 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
12086 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12087 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12088 __PYX_ERR(1, 516, __pyx_L1_error)
12090 __Pyx_INCREF(__pyx_v_bytesvalue);
12091 __pyx_t_10 = __pyx_v_bytesvalue;
12092 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12093 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12094 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12095 __pyx_t_11 = __pyx_t_14;
12096 __pyx_v_c = (__pyx_t_11[0]);
12105 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12106 __pyx_v_i = __pyx_t_9;
12115 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
12116 __pyx_t_9 = (__pyx_t_9 + 1);
12125 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
12126 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12128 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12139 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12142 __Pyx_XDECREF(__pyx_t_1);
12143 __Pyx_XDECREF(__pyx_t_4);
12144 __Pyx_XDECREF(__pyx_t_5);
12145 __Pyx_XDECREF(__pyx_t_6);
12146 __Pyx_XDECREF(__pyx_t_8);
12147 __Pyx_XDECREF(__pyx_t_10);
12148 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12151 __Pyx_XDECREF(__pyx_v_struct);
12152 __Pyx_XDECREF(__pyx_v_bytesvalue);
12153 __Pyx_XGIVEREF(__pyx_r);
12154 __Pyx_TraceReturn(__pyx_r, 0);
12155 __Pyx_RefNannyFinishContext();
12168 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12169 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12171 __Pyx_RefNannyDeclarations
12172 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12173 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12176 __Pyx_RefNannyFinishContext();
12180 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12182 __Pyx_TraceDeclarations
12183 __Pyx_RefNannyDeclarations
12186 PyObject *__pyx_t_3 = NULL;
12187 Py_ssize_t *__pyx_t_4;
12191 Py_ssize_t __pyx_t_8;
12192 int __pyx_lineno = 0;
12193 const char *__pyx_filename = NULL;
12194 int __pyx_clineno = 0;
12195 if (__pyx_v_info == NULL) {
12196 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12199 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12200 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12201 __Pyx_GIVEREF(__pyx_v_info->obj);
12202 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
12211 __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
12212 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12215 __pyx_t_1 = __pyx_t_2;
12216 goto __pyx_L4_bool_binop_done;
12218 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12219 __pyx_t_1 = __pyx_t_2;
12220 __pyx_L4_bool_binop_done:;
12221 if (unlikely(__pyx_t_1)) {
12230 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
12231 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
12232 __Pyx_GOTREF(__pyx_t_3);
12233 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12234 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12235 __PYX_ERR(1, 522, __pyx_L1_error)
12253 __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
12254 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12264 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
12265 __pyx_t_4 = __pyx_v_self->view.shape;
12266 __pyx_v_info->shape = __pyx_t_4;
12285 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
12287 __pyx_v_info->shape = NULL;
12298 __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
12299 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12309 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
12310 __pyx_t_4 = __pyx_v_self->view.strides;
12311 __pyx_v_info->strides = __pyx_t_4;
12330 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
12332 __pyx_v_info->strides = NULL;
12343 __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
12344 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12354 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
12355 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12356 __pyx_v_info->suboffsets = __pyx_t_4;
12375 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
12377 __pyx_v_info->suboffsets = NULL;
12388 __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
12389 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12399 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
12400 __pyx_t_5 = __pyx_v_self->view.format;
12401 __pyx_v_info->format = __pyx_t_5;
12420 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
12422 __pyx_v_info->format = NULL;
12433 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
12434 __pyx_t_6 = __pyx_v_self->view.buf;
12435 __pyx_v_info->buf = __pyx_t_6;
12444 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
12445 __pyx_t_7 = __pyx_v_self->view.ndim;
12446 __pyx_v_info->ndim = __pyx_t_7;
12455 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
12456 __pyx_t_8 = __pyx_v_self->view.itemsize;
12457 __pyx_v_info->itemsize = __pyx_t_8;
12466 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
12467 __pyx_t_8 = __pyx_v_self->view.len;
12468 __pyx_v_info->len = __pyx_t_8;
12477 __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
12478 __pyx_t_1 = __pyx_v_self->view.readonly;
12479 __pyx_v_info->readonly = __pyx_t_1;
12488 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
12489 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12490 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12491 __Pyx_GOTREF(__pyx_v_info->obj);
12492 __Pyx_DECREF(__pyx_v_info->obj);
12493 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12507 __Pyx_XDECREF(__pyx_t_3);
12508 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12510 if (__pyx_v_info->obj != NULL) {
12511 __Pyx_GOTREF(__pyx_v_info->obj);
12512 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12516 if (__pyx_v_info->obj == Py_None) {
12517 __Pyx_GOTREF(__pyx_v_info->obj);
12518 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12521 __Pyx_TraceReturn(Py_None, 0);
12522 __Pyx_RefNannyFinishContext();
12535 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12536 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12537 PyObject *__pyx_r = 0;
12538 __Pyx_RefNannyDeclarations
12539 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12540 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12543 __Pyx_RefNannyFinishContext();
12547 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12548 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12549 PyObject *__pyx_r = NULL;
12550 __Pyx_TraceDeclarations
12551 __Pyx_RefNannyDeclarations
12552 PyObject *__pyx_t_1 = NULL;
12554 int __pyx_lineno = 0;
12555 const char *__pyx_filename = NULL;
12556 int __pyx_clineno = 0;
12557 __Pyx_RefNannySetupContext(
"__get__", 0);
12558 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
12567 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
12568 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
12569 __Pyx_GOTREF(__pyx_t_1);
12570 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
12571 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12581 __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
12582 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
12591 __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
12592 __Pyx_XDECREF(__pyx_r);
12593 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12594 __pyx_r = ((PyObject *)__pyx_v_result);
12607 __Pyx_XDECREF(__pyx_t_1);
12608 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12611 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12612 __Pyx_XGIVEREF(__pyx_r);
12613 __Pyx_TraceReturn(__pyx_r, 0);
12614 __Pyx_RefNannyFinishContext();
12627 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
12628 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12629 PyObject *__pyx_r = 0;
12630 __Pyx_RefNannyDeclarations
12631 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12632 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12635 __Pyx_RefNannyFinishContext();
12639 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12640 PyObject *__pyx_r = NULL;
12641 __Pyx_TraceDeclarations
12642 __Pyx_RefNannyDeclarations
12643 int __pyx_lineno = 0;
12644 const char *__pyx_filename = NULL;
12645 int __pyx_clineno = 0;
12646 __Pyx_RefNannySetupContext(
"__get__", 0);
12647 __Pyx_TraceCall(
"__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
12656 __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
12657 __Pyx_XDECREF(__pyx_r);
12658 __Pyx_INCREF(__pyx_v_self->obj);
12659 __pyx_r = __pyx_v_self->obj;
12672 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12675 __Pyx_XGIVEREF(__pyx_r);
12676 __Pyx_TraceReturn(__pyx_r, 0);
12677 __Pyx_RefNannyFinishContext();
12690 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
12691 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12692 PyObject *__pyx_r = 0;
12693 __Pyx_RefNannyDeclarations
12694 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12695 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12698 __Pyx_RefNannyFinishContext();
12702 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12703 Py_ssize_t __pyx_v_length;
12704 PyObject *__pyx_r = NULL;
12705 __Pyx_TraceDeclarations
12706 __Pyx_RefNannyDeclarations
12707 PyObject *__pyx_t_1 = NULL;
12708 Py_ssize_t *__pyx_t_2;
12709 Py_ssize_t *__pyx_t_3;
12710 Py_ssize_t *__pyx_t_4;
12711 PyObject *__pyx_t_5 = NULL;
12712 int __pyx_lineno = 0;
12713 const char *__pyx_filename = NULL;
12714 int __pyx_clineno = 0;
12715 __Pyx_RefNannySetupContext(
"__get__", 0);
12716 __Pyx_TraceCall(
"__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
12725 __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
12726 __Pyx_XDECREF(__pyx_r);
12727 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
12728 __Pyx_GOTREF(__pyx_t_1);
12729 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12730 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12731 __pyx_t_2 = __pyx_t_4;
12732 __pyx_v_length = (__pyx_t_2[0]);
12733 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12734 __Pyx_GOTREF(__pyx_t_5);
12735 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
12736 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12738 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
12739 __Pyx_GOTREF(__pyx_t_5);
12740 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12741 __pyx_r = __pyx_t_5;
12755 __Pyx_XDECREF(__pyx_t_1);
12756 __Pyx_XDECREF(__pyx_t_5);
12757 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12760 __Pyx_XGIVEREF(__pyx_r);
12761 __Pyx_TraceReturn(__pyx_r, 0);
12762 __Pyx_RefNannyFinishContext();
12775 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
12776 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12777 PyObject *__pyx_r = 0;
12778 __Pyx_RefNannyDeclarations
12779 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12780 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12783 __Pyx_RefNannyFinishContext();
12787 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12788 Py_ssize_t __pyx_v_stride;
12789 PyObject *__pyx_r = NULL;
12790 __Pyx_TraceDeclarations
12791 __Pyx_RefNannyDeclarations
12793 PyObject *__pyx_t_2 = NULL;
12794 Py_ssize_t *__pyx_t_3;
12795 Py_ssize_t *__pyx_t_4;
12796 Py_ssize_t *__pyx_t_5;
12797 PyObject *__pyx_t_6 = NULL;
12798 int __pyx_lineno = 0;
12799 const char *__pyx_filename = NULL;
12800 int __pyx_clineno = 0;
12801 __Pyx_RefNannySetupContext(
"__get__", 0);
12802 __Pyx_TraceCall(
"__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
12811 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12812 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12813 if (unlikely(__pyx_t_1)) {
12822 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12823 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12824 __Pyx_GOTREF(__pyx_t_2);
12825 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12826 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12827 __PYX_ERR(1, 572, __pyx_L1_error)
12845 __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
12846 __Pyx_XDECREF(__pyx_r);
12847 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
12848 __Pyx_GOTREF(__pyx_t_2);
12849 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12850 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12851 __pyx_t_3 = __pyx_t_5;
12852 __pyx_v_stride = (__pyx_t_3[0]);
12853 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12854 __Pyx_GOTREF(__pyx_t_6);
12855 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
12856 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12858 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12859 __Pyx_GOTREF(__pyx_t_6);
12860 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12861 __pyx_r = __pyx_t_6;
12875 __Pyx_XDECREF(__pyx_t_2);
12876 __Pyx_XDECREF(__pyx_t_6);
12877 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12880 __Pyx_XGIVEREF(__pyx_r);
12881 __Pyx_TraceReturn(__pyx_r, 0);
12882 __Pyx_RefNannyFinishContext();
12895 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
12896 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12897 PyObject *__pyx_r = 0;
12898 __Pyx_RefNannyDeclarations
12899 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12900 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12903 __Pyx_RefNannyFinishContext();
12907 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12908 Py_ssize_t __pyx_v_suboffset;
12909 PyObject *__pyx_r = NULL;
12910 __Pyx_TraceDeclarations
12911 __Pyx_RefNannyDeclarations
12913 PyObject *__pyx_t_2 = NULL;
12914 PyObject *__pyx_t_3 = NULL;
12915 Py_ssize_t *__pyx_t_4;
12916 Py_ssize_t *__pyx_t_5;
12917 Py_ssize_t *__pyx_t_6;
12918 int __pyx_lineno = 0;
12919 const char *__pyx_filename = NULL;
12920 int __pyx_clineno = 0;
12921 __Pyx_RefNannySetupContext(
"__get__", 0);
12922 __Pyx_TraceCall(
"__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
12931 __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
12932 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12942 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12943 __Pyx_XDECREF(__pyx_r);
12944 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12945 __Pyx_GOTREF(__pyx_t_2);
12946 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12947 __Pyx_GOTREF(__pyx_t_3);
12948 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12949 __pyx_r = __pyx_t_3;
12969 __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
12970 __Pyx_XDECREF(__pyx_r);
12971 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
12972 __Pyx_GOTREF(__pyx_t_3);
12973 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12974 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12975 __pyx_t_4 = __pyx_t_6;
12976 __pyx_v_suboffset = (__pyx_t_4[0]);
12977 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12978 __Pyx_GOTREF(__pyx_t_2);
12979 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
12980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12982 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12983 __Pyx_GOTREF(__pyx_t_2);
12984 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12985 __pyx_r = __pyx_t_2;
12999 __Pyx_XDECREF(__pyx_t_2);
13000 __Pyx_XDECREF(__pyx_t_3);
13001 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13004 __Pyx_XGIVEREF(__pyx_r);
13005 __Pyx_TraceReturn(__pyx_r, 0);
13006 __Pyx_RefNannyFinishContext();
13019 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13020 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13021 PyObject *__pyx_r = 0;
13022 __Pyx_RefNannyDeclarations
13023 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13024 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13027 __Pyx_RefNannyFinishContext();
13031 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13032 PyObject *__pyx_r = NULL;
13033 __Pyx_TraceDeclarations
13034 __Pyx_RefNannyDeclarations
13035 PyObject *__pyx_t_1 = NULL;
13036 int __pyx_lineno = 0;
13037 const char *__pyx_filename = NULL;
13038 int __pyx_clineno = 0;
13039 __Pyx_RefNannySetupContext(
"__get__", 0);
13040 __Pyx_TraceCall(
"__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
13049 __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
13050 __Pyx_XDECREF(__pyx_r);
13051 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
13052 __Pyx_GOTREF(__pyx_t_1);
13053 __pyx_r = __pyx_t_1;
13067 __Pyx_XDECREF(__pyx_t_1);
13068 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13071 __Pyx_XGIVEREF(__pyx_r);
13072 __Pyx_TraceReturn(__pyx_r, 0);
13073 __Pyx_RefNannyFinishContext();
13086 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13087 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13088 PyObject *__pyx_r = 0;
13089 __Pyx_RefNannyDeclarations
13090 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13091 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13094 __Pyx_RefNannyFinishContext();
13098 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13099 PyObject *__pyx_r = NULL;
13100 __Pyx_TraceDeclarations
13101 __Pyx_RefNannyDeclarations
13102 PyObject *__pyx_t_1 = NULL;
13103 int __pyx_lineno = 0;
13104 const char *__pyx_filename = NULL;
13105 int __pyx_clineno = 0;
13106 __Pyx_RefNannySetupContext(
"__get__", 0);
13107 __Pyx_TraceCall(
"__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
13116 __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
13117 __Pyx_XDECREF(__pyx_r);
13118 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
13119 __Pyx_GOTREF(__pyx_t_1);
13120 __pyx_r = __pyx_t_1;
13134 __Pyx_XDECREF(__pyx_t_1);
13135 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13138 __Pyx_XGIVEREF(__pyx_r);
13139 __Pyx_TraceReturn(__pyx_r, 0);
13140 __Pyx_RefNannyFinishContext();
13153 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13154 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13155 PyObject *__pyx_r = 0;
13156 __Pyx_RefNannyDeclarations
13157 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13158 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13161 __Pyx_RefNannyFinishContext();
13165 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13166 PyObject *__pyx_r = NULL;
13167 __Pyx_TraceDeclarations
13168 __Pyx_RefNannyDeclarations
13169 PyObject *__pyx_t_1 = NULL;
13170 PyObject *__pyx_t_2 = NULL;
13171 PyObject *__pyx_t_3 = NULL;
13172 int __pyx_lineno = 0;
13173 const char *__pyx_filename = NULL;
13174 int __pyx_clineno = 0;
13175 __Pyx_RefNannySetupContext(
"__get__", 0);
13176 __Pyx_TraceCall(
"__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
13185 __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
13186 __Pyx_XDECREF(__pyx_r);
13187 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
13188 __Pyx_GOTREF(__pyx_t_1);
13189 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
13190 __Pyx_GOTREF(__pyx_t_2);
13191 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
13192 __Pyx_GOTREF(__pyx_t_3);
13193 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13194 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13195 __pyx_r = __pyx_t_3;
13209 __Pyx_XDECREF(__pyx_t_1);
13210 __Pyx_XDECREF(__pyx_t_2);
13211 __Pyx_XDECREF(__pyx_t_3);
13212 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13215 __Pyx_XGIVEREF(__pyx_r);
13216 __Pyx_TraceReturn(__pyx_r, 0);
13217 __Pyx_RefNannyFinishContext();
13230 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13231 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13232 PyObject *__pyx_r = 0;
13233 __Pyx_RefNannyDeclarations
13234 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13235 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13238 __Pyx_RefNannyFinishContext();
13242 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13243 PyObject *__pyx_v_result = NULL;
13244 PyObject *__pyx_v_length = NULL;
13245 PyObject *__pyx_r = NULL;
13246 __Pyx_TraceDeclarations
13247 __Pyx_RefNannyDeclarations
13250 Py_ssize_t *__pyx_t_3;
13251 Py_ssize_t *__pyx_t_4;
13252 Py_ssize_t *__pyx_t_5;
13253 PyObject *__pyx_t_6 = NULL;
13254 int __pyx_lineno = 0;
13255 const char *__pyx_filename = NULL;
13256 int __pyx_clineno = 0;
13257 __Pyx_RefNannySetupContext(
"__get__", 0);
13258 __Pyx_TraceCall(
"__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
13267 __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
13268 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13269 __pyx_t_2 = (__pyx_t_1 != 0);
13279 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
13280 __Pyx_INCREF(__pyx_int_1);
13281 __pyx_v_result = __pyx_int_1;
13290 __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
13291 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13292 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13293 __pyx_t_3 = __pyx_t_5;
13294 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
13295 __Pyx_GOTREF(__pyx_t_6);
13296 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13306 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
13307 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
13308 __Pyx_GOTREF(__pyx_t_6);
13309 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13320 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
13321 __Pyx_INCREF(__pyx_v_result);
13322 __Pyx_GIVEREF(__pyx_v_result);
13323 __Pyx_GOTREF(__pyx_v_self->_size);
13324 __Pyx_DECREF(__pyx_v_self->_size);
13325 __pyx_v_self->_size = __pyx_v_result;
13343 __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
13344 __Pyx_XDECREF(__pyx_r);
13345 __Pyx_INCREF(__pyx_v_self->_size);
13346 __pyx_r = __pyx_v_self->_size;
13359 __Pyx_XDECREF(__pyx_t_6);
13360 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13363 __Pyx_XDECREF(__pyx_v_result);
13364 __Pyx_XDECREF(__pyx_v_length);
13365 __Pyx_XGIVEREF(__pyx_r);
13366 __Pyx_TraceReturn(__pyx_r, 0);
13367 __Pyx_RefNannyFinishContext();
13380 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13381 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13382 Py_ssize_t __pyx_r;
13383 __Pyx_RefNannyDeclarations
13384 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13385 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13388 __Pyx_RefNannyFinishContext();
13392 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13393 Py_ssize_t __pyx_r;
13394 __Pyx_TraceDeclarations
13395 __Pyx_RefNannyDeclarations
13397 int __pyx_lineno = 0;
13398 const char *__pyx_filename = NULL;
13399 int __pyx_clineno = 0;
13400 __Pyx_RefNannySetupContext(
"__len__", 0);
13401 __Pyx_TraceCall(
"__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
13410 __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
13411 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13421 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
13422 __pyx_r = (__pyx_v_self->view.shape[0]);
13441 __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
13455 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13458 __Pyx_TraceReturn(Py_None, 0);
13459 __Pyx_RefNannyFinishContext();
13472 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13473 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13474 PyObject *__pyx_r = 0;
13475 __Pyx_RefNannyDeclarations
13476 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13477 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13480 __Pyx_RefNannyFinishContext();
13484 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13485 PyObject *__pyx_r = NULL;
13486 __Pyx_TraceDeclarations
13487 __Pyx_RefNannyDeclarations
13488 PyObject *__pyx_t_1 = NULL;
13489 PyObject *__pyx_t_2 = NULL;
13490 PyObject *__pyx_t_3 = NULL;
13491 int __pyx_lineno = 0;
13492 const char *__pyx_filename = NULL;
13493 int __pyx_clineno = 0;
13494 __Pyx_RefNannySetupContext(
"__repr__", 0);
13495 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
13504 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13505 __Pyx_XDECREF(__pyx_r);
13506 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13507 __Pyx_GOTREF(__pyx_t_1);
13508 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13509 __Pyx_GOTREF(__pyx_t_2);
13510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13511 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
13512 __Pyx_GOTREF(__pyx_t_1);
13513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13522 __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
13523 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
13524 __Pyx_GOTREF(__pyx_t_2);
13533 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
13534 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
13535 __Pyx_GOTREF(__pyx_t_3);
13536 __Pyx_GIVEREF(__pyx_t_1);
13537 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13538 __Pyx_GIVEREF(__pyx_t_2);
13539 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13542 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
13543 __Pyx_GOTREF(__pyx_t_2);
13544 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13545 __pyx_r = __pyx_t_2;
13559 __Pyx_XDECREF(__pyx_t_1);
13560 __Pyx_XDECREF(__pyx_t_2);
13561 __Pyx_XDECREF(__pyx_t_3);
13562 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13565 __Pyx_XGIVEREF(__pyx_r);
13566 __Pyx_TraceReturn(__pyx_r, 0);
13567 __Pyx_RefNannyFinishContext();
13580 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
13581 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13582 PyObject *__pyx_r = 0;
13583 __Pyx_RefNannyDeclarations
13584 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
13585 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13588 __Pyx_RefNannyFinishContext();
13592 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13593 PyObject *__pyx_r = NULL;
13594 __Pyx_TraceDeclarations
13595 __Pyx_RefNannyDeclarations
13596 PyObject *__pyx_t_1 = NULL;
13597 PyObject *__pyx_t_2 = NULL;
13598 int __pyx_lineno = 0;
13599 const char *__pyx_filename = NULL;
13600 int __pyx_clineno = 0;
13601 __Pyx_RefNannySetupContext(
"__str__", 0);
13602 __Pyx_TraceCall(
"__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
13611 __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
13612 __Pyx_XDECREF(__pyx_r);
13613 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13614 __Pyx_GOTREF(__pyx_t_1);
13615 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13616 __Pyx_GOTREF(__pyx_t_2);
13617 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13618 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13619 __Pyx_GOTREF(__pyx_t_1);
13620 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13621 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
13622 __Pyx_GOTREF(__pyx_t_2);
13623 __Pyx_GIVEREF(__pyx_t_1);
13624 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13626 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
13627 __Pyx_GOTREF(__pyx_t_1);
13628 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13629 __pyx_r = __pyx_t_1;
13643 __Pyx_XDECREF(__pyx_t_1);
13644 __Pyx_XDECREF(__pyx_t_2);
13645 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13648 __Pyx_XGIVEREF(__pyx_r);
13649 __Pyx_TraceReturn(__pyx_r, 0);
13650 __Pyx_RefNannyFinishContext();
13663 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13664 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13665 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13666 PyObject *__pyx_r = 0;
13667 __Pyx_RefNannyDeclarations
13668 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
13669 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13672 __Pyx_RefNannyFinishContext();
13676 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13677 __Pyx_memviewslice *__pyx_v_mslice;
13678 __Pyx_memviewslice __pyx_v_tmp;
13679 PyObject *__pyx_r = NULL;
13680 __Pyx_TraceDeclarations
13681 __Pyx_RefNannyDeclarations
13682 __Pyx_memviewslice *__pyx_t_1;
13683 PyObject *__pyx_t_2 = NULL;
13684 int __pyx_lineno = 0;
13685 const char *__pyx_filename = NULL;
13686 int __pyx_clineno = 0;
13687 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13688 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
13697 __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
13698 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
13699 __pyx_v_mslice = __pyx_t_1;
13708 __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
13709 __Pyx_XDECREF(__pyx_r);
13710 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
13711 __Pyx_GOTREF(__pyx_t_2);
13712 __pyx_r = __pyx_t_2;
13726 __Pyx_XDECREF(__pyx_t_2);
13727 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13730 __Pyx_XGIVEREF(__pyx_r);
13731 __Pyx_TraceReturn(__pyx_r, 0);
13732 __Pyx_RefNannyFinishContext();
13745 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13746 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13747 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13748 PyObject *__pyx_r = 0;
13749 __Pyx_RefNannyDeclarations
13750 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
13751 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13754 __Pyx_RefNannyFinishContext();
13758 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13759 __Pyx_memviewslice *__pyx_v_mslice;
13760 __Pyx_memviewslice __pyx_v_tmp;
13761 PyObject *__pyx_r = NULL;
13762 __Pyx_TraceDeclarations
13763 __Pyx_RefNannyDeclarations
13764 __Pyx_memviewslice *__pyx_t_1;
13765 PyObject *__pyx_t_2 = NULL;
13766 int __pyx_lineno = 0;
13767 const char *__pyx_filename = NULL;
13768 int __pyx_clineno = 0;
13769 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
13770 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
13779 __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
13780 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
13781 __pyx_v_mslice = __pyx_t_1;
13790 __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
13791 __Pyx_XDECREF(__pyx_r);
13792 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
13793 __Pyx_GOTREF(__pyx_t_2);
13794 __pyx_r = __pyx_t_2;
13808 __Pyx_XDECREF(__pyx_t_2);
13809 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13812 __Pyx_XGIVEREF(__pyx_r);
13813 __Pyx_TraceReturn(__pyx_r, 0);
13814 __Pyx_RefNannyFinishContext();
13827 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13828 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13829 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13830 PyObject *__pyx_r = 0;
13831 __Pyx_RefNannyDeclarations
13832 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13833 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13836 __Pyx_RefNannyFinishContext();
13840 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13841 __Pyx_memviewslice __pyx_v_mslice;
13843 PyObject *__pyx_r = NULL;
13844 __Pyx_TraceDeclarations
13845 __Pyx_RefNannyDeclarations
13846 __Pyx_memviewslice __pyx_t_1;
13847 PyObject *__pyx_t_2 = NULL;
13848 int __pyx_lineno = 0;
13849 const char *__pyx_filename = NULL;
13850 int __pyx_clineno = 0;
13851 __Pyx_RefNannySetupContext(
"copy", 0);
13852 __Pyx_TraceCall(
"copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
13861 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13862 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13871 __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
13872 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13881 __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
13882 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
13883 __pyx_v_mslice = __pyx_t_1;
13892 __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
13893 __Pyx_XDECREF(__pyx_r);
13894 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
13895 __Pyx_GOTREF(__pyx_t_2);
13896 __pyx_r = __pyx_t_2;
13910 __Pyx_XDECREF(__pyx_t_2);
13911 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13914 __Pyx_XGIVEREF(__pyx_r);
13915 __Pyx_TraceReturn(__pyx_r, 0);
13916 __Pyx_RefNannyFinishContext();
13929 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13930 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13931 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13932 PyObject *__pyx_r = 0;
13933 __Pyx_RefNannyDeclarations
13934 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
13935 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13938 __Pyx_RefNannyFinishContext();
13942 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
13943 __Pyx_memviewslice __pyx_v_src;
13944 __Pyx_memviewslice __pyx_v_dst;
13946 PyObject *__pyx_r = NULL;
13947 __Pyx_TraceDeclarations
13948 __Pyx_RefNannyDeclarations
13949 __Pyx_memviewslice __pyx_t_1;
13950 PyObject *__pyx_t_2 = NULL;
13951 int __pyx_lineno = 0;
13952 const char *__pyx_filename = NULL;
13953 int __pyx_clineno = 0;
13954 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
13955 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
13964 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13965 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13974 __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
13975 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13984 __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
13985 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
13986 __pyx_v_dst = __pyx_t_1;
13995 __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
13996 __Pyx_XDECREF(__pyx_r);
13997 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
13998 __Pyx_GOTREF(__pyx_t_2);
13999 __pyx_r = __pyx_t_2;
14013 __Pyx_XDECREF(__pyx_t_2);
14014 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14017 __Pyx_XGIVEREF(__pyx_r);
14018 __Pyx_TraceReturn(__pyx_r, 0);
14019 __Pyx_RefNannyFinishContext();
14030 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14031 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14032 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14033 PyObject *__pyx_r = 0;
14034 __Pyx_RefNannyDeclarations
14035 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14036 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14039 __Pyx_RefNannyFinishContext();
14043 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14044 PyObject *__pyx_r = NULL;
14045 __Pyx_TraceDeclarations
14046 __Pyx_RefNannyDeclarations
14047 PyObject *__pyx_t_1 = NULL;
14048 int __pyx_lineno = 0;
14049 const char *__pyx_filename = NULL;
14050 int __pyx_clineno = 0;
14051 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14052 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14060 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
14061 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14062 __Pyx_GOTREF(__pyx_t_1);
14063 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14064 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14065 __PYX_ERR(1, 2, __pyx_L1_error)
14075 __Pyx_XDECREF(__pyx_t_1);
14076 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14078 __Pyx_XGIVEREF(__pyx_r);
14079 __Pyx_TraceReturn(__pyx_r, 0);
14080 __Pyx_RefNannyFinishContext();
14092 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14093 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14094 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14095 PyObject *__pyx_r = 0;
14096 __Pyx_RefNannyDeclarations
14097 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14098 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14101 __Pyx_RefNannyFinishContext();
14105 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14106 PyObject *__pyx_r = NULL;
14107 __Pyx_TraceDeclarations
14108 __Pyx_RefNannyDeclarations
14109 PyObject *__pyx_t_1 = NULL;
14110 int __pyx_lineno = 0;
14111 const char *__pyx_filename = NULL;
14112 int __pyx_clineno = 0;
14113 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14114 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14121 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
14122 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14123 __Pyx_GOTREF(__pyx_t_1);
14124 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14125 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14126 __PYX_ERR(1, 4, __pyx_L1_error)
14137 __Pyx_XDECREF(__pyx_t_1);
14138 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14140 __Pyx_XGIVEREF(__pyx_r);
14141 __Pyx_TraceReturn(__pyx_r, 0);
14142 __Pyx_RefNannyFinishContext();
14154 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14155 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14156 PyObject *__pyx_r = NULL;
14157 __Pyx_TraceDeclarations
14158 __Pyx_RefNannyDeclarations
14159 PyObject *__pyx_t_1 = NULL;
14160 PyObject *__pyx_t_2 = NULL;
14161 PyObject *__pyx_t_3 = NULL;
14162 int __pyx_lineno = 0;
14163 const char *__pyx_filename = NULL;
14164 int __pyx_clineno = 0;
14165 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14166 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
14175 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
14176 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
14177 __Pyx_GOTREF(__pyx_t_1);
14178 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14179 __Pyx_GOTREF(__pyx_t_2);
14180 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
14181 __Pyx_GOTREF(__pyx_t_3);
14182 __Pyx_INCREF(__pyx_v_o);
14183 __Pyx_GIVEREF(__pyx_v_o);
14184 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14185 __Pyx_GIVEREF(__pyx_t_1);
14186 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14187 __Pyx_GIVEREF(__pyx_t_2);
14188 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14191 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
14192 __Pyx_GOTREF(__pyx_t_2);
14193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14194 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14204 __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
14205 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14214 __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
14215 __Pyx_XDECREF(__pyx_r);
14216 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14217 __pyx_r = ((PyObject *)__pyx_v_result);
14230 __Pyx_XDECREF(__pyx_t_1);
14231 __Pyx_XDECREF(__pyx_t_2);
14232 __Pyx_XDECREF(__pyx_t_3);
14233 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14236 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14237 __Pyx_XGIVEREF(__pyx_r);
14238 __Pyx_TraceReturn(__pyx_r, 0);
14239 __Pyx_RefNannyFinishContext();
14251 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14253 __Pyx_TraceDeclarations
14254 __Pyx_RefNannyDeclarations
14256 int __pyx_lineno = 0;
14257 const char *__pyx_filename = NULL;
14258 int __pyx_clineno = 0;
14259 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14260 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
14269 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
14270 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14271 __pyx_r = __pyx_t_1;
14284 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14287 __Pyx_TraceReturn(Py_None, 0);
14288 __Pyx_RefNannyFinishContext();
14300 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14301 PyObject *__pyx_v_tup = NULL;
14302 PyObject *__pyx_v_result = NULL;
14303 int __pyx_v_have_slices;
14304 int __pyx_v_seen_ellipsis;
14305 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14306 PyObject *__pyx_v_item = NULL;
14307 Py_ssize_t __pyx_v_nslices;
14308 PyObject *__pyx_r = NULL;
14309 __Pyx_TraceDeclarations
14310 __Pyx_RefNannyDeclarations
14313 PyObject *__pyx_t_3 = NULL;
14314 PyObject *__pyx_t_4 = NULL;
14315 Py_ssize_t __pyx_t_5;
14316 PyObject *(*__pyx_t_6)(PyObject *);
14317 PyObject *__pyx_t_7 = NULL;
14318 Py_ssize_t __pyx_t_8;
14321 PyObject *__pyx_t_11 = NULL;
14322 int __pyx_lineno = 0;
14323 const char *__pyx_filename = NULL;
14324 int __pyx_clineno = 0;
14325 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14326 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
14335 __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
14336 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14337 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14347 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
14348 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
14349 __Pyx_GOTREF(__pyx_t_3);
14350 __Pyx_INCREF(__pyx_v_index);
14351 __Pyx_GIVEREF(__pyx_v_index);
14352 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14353 __pyx_v_tup = __pyx_t_3;
14373 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
14375 __Pyx_INCREF(__pyx_v_index);
14376 __pyx_v_tup = __pyx_v_index;
14387 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
14388 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
14389 __Pyx_GOTREF(__pyx_t_3);
14390 __pyx_v_result = ((PyObject*)__pyx_t_3);
14400 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14401 __pyx_v_have_slices = 0;
14410 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
14411 __pyx_v_seen_ellipsis = 0;
14420 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14421 __Pyx_INCREF(__pyx_int_0);
14422 __pyx_t_3 = __pyx_int_0;
14423 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14424 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14427 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
14428 __Pyx_GOTREF(__pyx_t_4);
14429 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
14432 if (likely(!__pyx_t_6)) {
14433 if (likely(PyList_CheckExact(__pyx_t_4))) {
14434 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14435 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14436 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14438 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14439 __Pyx_GOTREF(__pyx_t_7);
14442 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14443 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14444 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
14446 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14447 __Pyx_GOTREF(__pyx_t_7);
14451 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14452 if (unlikely(!__pyx_t_7)) {
14453 PyObject* exc_type = PyErr_Occurred();
14455 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14456 else __PYX_ERR(1, 681, __pyx_L1_error)
14460 __Pyx_GOTREF(__pyx_t_7);
14462 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14464 __Pyx_INCREF(__pyx_t_3);
14465 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14466 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
14467 __Pyx_GOTREF(__pyx_t_7);
14468 __Pyx_DECREF(__pyx_t_3);
14469 __pyx_t_3 = __pyx_t_7;
14479 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
14480 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14481 __pyx_t_1 = (__pyx_t_2 != 0);
14491 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
14492 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14502 __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
14503 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14504 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
14505 __Pyx_GOTREF(__pyx_t_7);
14506 { Py_ssize_t __pyx_temp;
14507 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14508 __Pyx_INCREF(__pyx_slice__32);
14509 __Pyx_GIVEREF(__pyx_slice__32);
14510 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
14513 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
14514 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14523 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
14524 __pyx_v_seen_ellipsis = 1;
14543 __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
14545 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
14556 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
14557 __pyx_v_have_slices = 1;
14576 __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
14578 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14579 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14582 __pyx_t_1 = __pyx_t_10;
14583 goto __pyx_L9_bool_binop_done;
14585 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14586 __pyx_t_1 = __pyx_t_10;
14587 __pyx_L9_bool_binop_done:;
14588 if (unlikely(__pyx_t_1)) {
14597 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
14598 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
14599 __Pyx_GOTREF(__pyx_t_7);
14600 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
14601 __Pyx_GOTREF(__pyx_t_11);
14602 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14603 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14604 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14605 __PYX_ERR(1, 691, __pyx_L1_error)
14623 __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
14624 __pyx_t_10 = (__pyx_v_have_slices != 0);
14627 __pyx_t_1 = __pyx_t_10;
14628 goto __pyx_L11_bool_binop_done;
14630 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14631 __pyx_t_2 = (__pyx_t_10 != 0);
14632 __pyx_t_1 = __pyx_t_2;
14633 __pyx_L11_bool_binop_done:;
14634 __pyx_v_have_slices = __pyx_t_1;
14643 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
14644 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14655 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14657 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14658 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14667 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
14668 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14669 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14678 __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
14679 __pyx_t_1 = (__pyx_v_nslices != 0);
14689 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14690 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
14691 __Pyx_GOTREF(__pyx_t_3);
14692 { Py_ssize_t __pyx_temp;
14693 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14694 __Pyx_INCREF(__pyx_slice__32);
14695 __Pyx_GIVEREF(__pyx_slice__32);
14696 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14699 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
14700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14718 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
14719 __Pyx_XDECREF(__pyx_r);
14720 if (!__pyx_v_have_slices) {
14722 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14723 __Pyx_GOTREF(__pyx_t_4);
14724 __pyx_t_3 = __pyx_t_4;
14726 goto __pyx_L14_bool_binop_done;
14728 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14729 __Pyx_GOTREF(__pyx_t_4);
14730 __pyx_t_3 = __pyx_t_4;
14732 __pyx_L14_bool_binop_done:;
14733 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
14734 __Pyx_GOTREF(__pyx_t_4);
14735 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
14736 __Pyx_GOTREF(__pyx_t_11);
14737 __Pyx_GIVEREF(__pyx_t_3);
14738 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14739 __Pyx_GIVEREF(__pyx_t_4);
14740 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14743 __pyx_r = ((PyObject*)__pyx_t_11);
14757 __Pyx_XDECREF(__pyx_t_3);
14758 __Pyx_XDECREF(__pyx_t_4);
14759 __Pyx_XDECREF(__pyx_t_7);
14760 __Pyx_XDECREF(__pyx_t_11);
14761 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14764 __Pyx_XDECREF(__pyx_v_tup);
14765 __Pyx_XDECREF(__pyx_v_result);
14766 __Pyx_XDECREF(__pyx_v_idx);
14767 __Pyx_XDECREF(__pyx_v_item);
14768 __Pyx_XGIVEREF(__pyx_r);
14769 __Pyx_TraceReturn(__pyx_r, 0);
14770 __Pyx_RefNannyFinishContext();
14782 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14783 Py_ssize_t __pyx_v_suboffset;
14784 PyObject *__pyx_r = NULL;
14785 __Pyx_TraceDeclarations
14786 __Pyx_RefNannyDeclarations
14787 Py_ssize_t *__pyx_t_1;
14788 Py_ssize_t *__pyx_t_2;
14789 Py_ssize_t *__pyx_t_3;
14791 PyObject *__pyx_t_5 = NULL;
14792 int __pyx_lineno = 0;
14793 const char *__pyx_filename = NULL;
14794 int __pyx_clineno = 0;
14795 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14796 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
14805 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14806 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14807 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14808 __pyx_t_1 = __pyx_t_3;
14809 __pyx_v_suboffset = (__pyx_t_1[0]);
14818 __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
14819 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14820 if (unlikely(__pyx_t_4)) {
14829 __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
14830 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
14831 __Pyx_GOTREF(__pyx_t_5);
14832 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14833 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14834 __PYX_ERR(1, 705, __pyx_L1_error)
14855 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14858 __Pyx_XDECREF(__pyx_t_5);
14859 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14862 __Pyx_XGIVEREF(__pyx_r);
14863 __Pyx_TraceReturn(__pyx_r, 0);
14864 __Pyx_RefNannyFinishContext();
14876 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14877 int __pyx_v_new_ndim;
14878 int __pyx_v_suboffset_dim;
14880 __Pyx_memviewslice __pyx_v_src;
14881 __Pyx_memviewslice __pyx_v_dst;
14882 __Pyx_memviewslice *__pyx_v_p_src;
14883 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14884 __Pyx_memviewslice *__pyx_v_p_dst;
14885 int *__pyx_v_p_suboffset_dim;
14886 Py_ssize_t __pyx_v_start;
14887 Py_ssize_t __pyx_v_stop;
14888 Py_ssize_t __pyx_v_step;
14889 int __pyx_v_have_start;
14890 int __pyx_v_have_stop;
14891 int __pyx_v_have_step;
14892 PyObject *__pyx_v_index = NULL;
14893 struct __pyx_memoryview_obj *__pyx_r = NULL;
14894 __Pyx_TraceDeclarations
14895 __Pyx_RefNannyDeclarations
14898 PyObject *__pyx_t_3 = NULL;
14899 struct __pyx_memoryview_obj *__pyx_t_4;
14902 Py_ssize_t __pyx_t_7;
14903 PyObject *(*__pyx_t_8)(PyObject *);
14904 PyObject *__pyx_t_9 = NULL;
14905 Py_ssize_t __pyx_t_10;
14907 Py_ssize_t __pyx_t_12;
14908 int __pyx_lineno = 0;
14909 const char *__pyx_filename = NULL;
14910 int __pyx_clineno = 0;
14911 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14912 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
14921 __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
14922 __pyx_v_new_ndim = 0;
14923 __pyx_v_suboffset_dim = -1;
14932 __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
14933 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14942 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14943 #ifndef CYTHON_WITHOUT_ASSERTIONS
14944 if (unlikely(__pyx_assertions_enabled())) {
14945 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14946 PyErr_SetNone(PyExc_AssertionError);
14947 __PYX_ERR(1, 724, __pyx_L1_error)
14959 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14960 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14961 __pyx_t_2 = (__pyx_t_1 != 0);
14971 __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
14972 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
14973 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14974 __Pyx_INCREF(__pyx_t_3);
14975 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14985 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14986 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15005 __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
15007 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15016 __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
15017 __pyx_v_p_src = (&__pyx_v_src);
15028 __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
15029 __pyx_t_4 = __pyx_v_p_src->memview;
15030 __pyx_v_dst.memview = __pyx_t_4;
15039 __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
15040 __pyx_t_5 = __pyx_v_p_src->data;
15041 __pyx_v_dst.data = __pyx_t_5;
15050 __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
15051 __pyx_v_p_dst = (&__pyx_v_dst);
15060 __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
15061 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15070 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
15072 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15073 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15076 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
15077 __Pyx_GOTREF(__pyx_t_3);
15078 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
15081 if (likely(!__pyx_t_8)) {
15082 if (likely(PyList_CheckExact(__pyx_t_3))) {
15083 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15084 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15085 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
15087 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
15088 __Pyx_GOTREF(__pyx_t_9);
15091 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15092 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15093 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
15095 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
15096 __Pyx_GOTREF(__pyx_t_9);
15100 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15101 if (unlikely(!__pyx_t_9)) {
15102 PyObject* exc_type = PyErr_Occurred();
15104 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15105 else __PYX_ERR(1, 748, __pyx_L1_error)
15109 __Pyx_GOTREF(__pyx_t_9);
15111 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15113 __pyx_v_dim = __pyx_t_6;
15114 __pyx_t_6 = (__pyx_t_6 + 1);
15123 __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
15124 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15134 __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
15135 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
15144 __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
15145 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
15164 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
15165 __pyx_t_2 = (__pyx_v_index == Py_None);
15166 __pyx_t_1 = (__pyx_t_2 != 0);
15176 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
15177 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15186 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
15187 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15196 __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
15197 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15206 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
15207 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15226 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
15228 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15229 __Pyx_GOTREF(__pyx_t_9);
15230 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15232 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15234 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15235 __pyx_t_10 = __pyx_t_12;
15236 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15237 goto __pyx_L7_bool_binop_done;
15240 __pyx_L7_bool_binop_done:;
15241 __pyx_v_start = __pyx_t_10;
15250 __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
15251 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
15252 __Pyx_GOTREF(__pyx_t_9);
15253 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
15255 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15257 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
15258 __pyx_t_10 = __pyx_t_12;
15259 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15260 goto __pyx_L9_bool_binop_done;
15263 __pyx_L9_bool_binop_done:;
15264 __pyx_v_stop = __pyx_t_10;
15273 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
15274 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15275 __Pyx_GOTREF(__pyx_t_9);
15276 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
15278 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15280 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
15281 __pyx_t_10 = __pyx_t_12;
15282 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15283 goto __pyx_L11_bool_binop_done;
15286 __pyx_L11_bool_binop_done:;
15287 __pyx_v_step = __pyx_t_10;
15296 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
15297 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15298 __Pyx_GOTREF(__pyx_t_9);
15299 __pyx_t_1 = (__pyx_t_9 != Py_None);
15300 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15301 __pyx_v_have_start = __pyx_t_1;
15310 __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
15311 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
15312 __Pyx_GOTREF(__pyx_t_9);
15313 __pyx_t_1 = (__pyx_t_9 != Py_None);
15314 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15315 __pyx_v_have_stop = __pyx_t_1;
15324 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
15325 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
15326 __Pyx_GOTREF(__pyx_t_9);
15327 __pyx_t_1 = (__pyx_t_9 != Py_None);
15328 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15329 __pyx_v_have_step = __pyx_t_1;
15338 __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
15339 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
15348 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
15349 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15360 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
15362 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15371 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
15372 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15373 __pyx_t_2 = (__pyx_t_1 != 0);
15383 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15384 __Pyx_XDECREF(((PyObject *)__pyx_r));
15393 __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
15394 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
15403 __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
15404 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
15413 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15414 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
15415 __Pyx_GOTREF(__pyx_t_3);
15416 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
15417 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15437 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15439 __Pyx_XDECREF(((PyObject *)__pyx_r));
15448 __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
15449 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
15450 __Pyx_GOTREF(__pyx_t_3);
15459 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
15460 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
15461 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15476 __Pyx_XDECREF(__pyx_t_3);
15477 __Pyx_XDECREF(__pyx_t_9);
15478 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15481 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15482 __Pyx_XDECREF(__pyx_v_index);
15483 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15484 __Pyx_TraceReturn(__pyx_r, 0);
15485 __Pyx_RefNannyFinishContext();
15497 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15498 Py_ssize_t __pyx_v_new_shape;
15499 int __pyx_v_negative_step;
15501 __Pyx_TraceDeclarations
15505 int __pyx_lineno = 0;
15506 const char *__pyx_filename = NULL;
15507 int __pyx_clineno = 0;
15508 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
15517 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
15518 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15528 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
15529 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15539 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
15540 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15558 __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
15559 __pyx_t_1 = (0 <= __pyx_v_start);
15561 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15563 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15573 __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
15574 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
15602 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
15604 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15607 __pyx_t_2 = __pyx_t_1;
15608 goto __pyx_L6_bool_binop_done;
15610 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15611 __pyx_t_2 = __pyx_t_1;
15612 __pyx_L6_bool_binop_done:;
15613 __pyx_v_negative_step = __pyx_t_2;
15622 __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
15623 __pyx_t_1 = (__pyx_v_have_step != 0);
15626 __pyx_t_2 = __pyx_t_1;
15627 goto __pyx_L9_bool_binop_done;
15629 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15630 __pyx_t_2 = __pyx_t_1;
15631 __pyx_L9_bool_binop_done:;
15641 __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
15642 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
15660 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
15661 __pyx_t_2 = (__pyx_v_have_start != 0);
15671 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
15672 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15682 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
15683 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15692 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15693 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15703 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15732 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15733 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15743 __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
15744 __pyx_t_2 = (__pyx_v_negative_step != 0);
15754 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15755 __pyx_v_start = (__pyx_v_shape - 1);
15774 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15776 __pyx_v_start = __pyx_v_shape;
15807 __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
15809 __pyx_t_2 = (__pyx_v_negative_step != 0);
15819 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15820 __pyx_v_start = (__pyx_v_shape - 1);
15839 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15854 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15855 __pyx_t_2 = (__pyx_v_have_stop != 0);
15865 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15866 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15876 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15877 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15886 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15887 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15897 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15926 __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
15927 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15937 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15938 __pyx_v_stop = __pyx_v_shape;
15967 __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
15969 __pyx_t_2 = (__pyx_v_negative_step != 0);
15979 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15980 __pyx_v_stop = -1L;
15999 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
16001 __pyx_v_stop = __pyx_v_shape;
16014 __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
16015 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16025 __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
16044 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16053 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16063 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16081 __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
16082 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16092 __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
16093 __pyx_v_new_shape = 0;
16111 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
16112 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16121 __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
16122 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16131 __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
16132 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16143 __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
16144 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16154 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
16155 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16174 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
16176 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16177 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16188 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
16189 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16199 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
16200 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16210 __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
16211 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16221 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
16222 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16241 __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
16251 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
16252 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
16273 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
16275 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16295 __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
16311 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16313 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16315 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16320 __Pyx_TraceReturn(Py_None, 1);
16332 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16333 Py_ssize_t __pyx_v_shape;
16334 Py_ssize_t __pyx_v_stride;
16335 Py_ssize_t __pyx_v_suboffset;
16336 Py_ssize_t __pyx_v_itemsize;
16337 char *__pyx_v_resultp;
16339 __Pyx_TraceDeclarations
16340 __Pyx_RefNannyDeclarations
16341 Py_ssize_t __pyx_t_1;
16343 PyObject *__pyx_t_3 = NULL;
16344 PyObject *__pyx_t_4 = NULL;
16345 int __pyx_lineno = 0;
16346 const char *__pyx_filename = NULL;
16347 int __pyx_clineno = 0;
16348 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16349 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
16358 __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
16359 __pyx_v_suboffset = -1L;
16368 __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
16369 __pyx_t_1 = __pyx_v_view->itemsize;
16370 __pyx_v_itemsize = __pyx_t_1;
16379 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
16380 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16390 __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
16391 if (unlikely(__pyx_v_itemsize == 0)) {
16392 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16393 __PYX_ERR(1, 919, __pyx_L1_error)
16395 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16396 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16397 __PYX_ERR(1, 919, __pyx_L1_error)
16399 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
16408 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
16409 __pyx_v_stride = __pyx_v_itemsize;
16428 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
16430 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16439 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
16440 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16449 __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
16450 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16460 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
16461 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16481 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
16482 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16492 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
16493 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16502 __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
16503 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16504 if (unlikely(__pyx_t_2)) {
16513 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
16514 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16515 __Pyx_GOTREF(__pyx_t_3);
16516 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
16517 __Pyx_GOTREF(__pyx_t_4);
16518 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16519 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
16520 __Pyx_GOTREF(__pyx_t_3);
16521 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16522 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16523 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16524 __PYX_ERR(1, 930, __pyx_L1_error)
16551 __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
16552 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16553 if (unlikely(__pyx_t_2)) {
16562 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
16563 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16564 __Pyx_GOTREF(__pyx_t_3);
16565 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
16566 __Pyx_GOTREF(__pyx_t_4);
16567 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16568 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
16569 __Pyx_GOTREF(__pyx_t_3);
16570 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16571 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16573 __PYX_ERR(1, 933, __pyx_L1_error)
16591 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
16592 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16601 __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
16602 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16612 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
16613 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16631 __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
16632 __pyx_r = __pyx_v_resultp;
16645 __Pyx_XDECREF(__pyx_t_3);
16646 __Pyx_XDECREF(__pyx_t_4);
16647 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16650 __Pyx_TraceReturn(Py_None, 0);
16651 __Pyx_RefNannyFinishContext();
16663 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16665 Py_ssize_t *__pyx_v_shape;
16666 Py_ssize_t *__pyx_v_strides;
16670 __Pyx_TraceDeclarations
16672 Py_ssize_t *__pyx_t_2;
16675 Py_ssize_t __pyx_t_5;
16676 Py_ssize_t __pyx_t_6;
16680 int __pyx_lineno = 0;
16681 const char *__pyx_filename = NULL;
16682 int __pyx_clineno = 0;
16683 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
16692 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16693 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16694 __pyx_v_ndim = __pyx_t_1;
16703 __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
16704 __pyx_t_2 = __pyx_v_memslice->shape;
16705 __pyx_v_shape = __pyx_t_2;
16714 __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
16715 __pyx_t_2 = __pyx_v_memslice->strides;
16716 __pyx_v_strides = __pyx_t_2;
16725 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16726 __pyx_t_3 = (__pyx_v_ndim / 2);
16727 __pyx_t_4 = __pyx_t_3;
16728 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16729 __pyx_v_i = __pyx_t_1;
16738 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16739 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16748 __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
16749 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16750 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16751 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16752 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16761 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16762 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16763 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16764 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16765 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16774 __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
16775 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16778 __pyx_t_7 = __pyx_t_8;
16779 goto __pyx_L6_bool_binop_done;
16781 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16782 __pyx_t_7 = __pyx_t_8;
16783 __pyx_L6_bool_binop_done:;
16793 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16794 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
16813 __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
16829 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16831 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16833 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16838 __Pyx_TraceReturn(Py_None, 1);
16851 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16852 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16853 __Pyx_RefNannyDeclarations
16854 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16855 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16858 __Pyx_RefNannyFinishContext();
16861 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16862 __Pyx_TraceDeclarations
16863 __Pyx_RefNannyDeclarations
16864 int __pyx_lineno = 0;
16865 const char *__pyx_filename = NULL;
16866 int __pyx_clineno = 0;
16867 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16868 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
16877 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
16878 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16891 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16893 __Pyx_TraceReturn(Py_None, 0);
16894 __Pyx_RefNannyFinishContext();
16905 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16906 PyObject *__pyx_r = NULL;
16907 __Pyx_TraceDeclarations
16908 __Pyx_RefNannyDeclarations
16910 PyObject *__pyx_t_2 = NULL;
16911 int __pyx_lineno = 0;
16912 const char *__pyx_filename = NULL;
16913 int __pyx_clineno = 0;
16914 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16915 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
16924 __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
16925 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16935 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16936 __Pyx_XDECREF(__pyx_r);
16937 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16938 __Pyx_GOTREF(__pyx_t_2);
16939 __pyx_r = __pyx_t_2;
16959 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
16961 __Pyx_XDECREF(__pyx_r);
16962 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
16963 __Pyx_GOTREF(__pyx_t_2);
16964 __pyx_r = __pyx_t_2;
16979 __Pyx_XDECREF(__pyx_t_2);
16980 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16983 __Pyx_XGIVEREF(__pyx_r);
16984 __Pyx_TraceReturn(__pyx_r, 0);
16985 __Pyx_RefNannyFinishContext();
16997 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16998 PyObject *__pyx_r = NULL;
16999 __Pyx_TraceDeclarations
17000 __Pyx_RefNannyDeclarations
17003 PyObject *__pyx_t_3 = NULL;
17004 int __pyx_lineno = 0;
17005 const char *__pyx_filename = NULL;
17006 int __pyx_clineno = 0;
17007 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17008 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
17017 __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
17018 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17028 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
17029 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
17048 __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
17050 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
17051 __Pyx_GOTREF(__pyx_t_3);
17052 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17065 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17068 __Pyx_XDECREF(__pyx_t_3);
17069 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17072 __Pyx_XGIVEREF(__pyx_r);
17073 __Pyx_TraceReturn(__pyx_r, 0);
17074 __Pyx_RefNannyFinishContext();
17087 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17088 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17089 PyObject *__pyx_r = 0;
17090 __Pyx_RefNannyDeclarations
17091 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17092 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17095 __Pyx_RefNannyFinishContext();
17099 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17100 PyObject *__pyx_r = NULL;
17101 __Pyx_TraceDeclarations
17102 __Pyx_RefNannyDeclarations
17103 int __pyx_lineno = 0;
17104 const char *__pyx_filename = NULL;
17105 int __pyx_clineno = 0;
17106 __Pyx_RefNannySetupContext(
"__get__", 0);
17107 __Pyx_TraceCall(
"__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
17116 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
17117 __Pyx_XDECREF(__pyx_r);
17118 __Pyx_INCREF(__pyx_v_self->from_object);
17119 __pyx_r = __pyx_v_self->from_object;
17132 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17135 __Pyx_XGIVEREF(__pyx_r);
17136 __Pyx_TraceReturn(__pyx_r, 0);
17137 __Pyx_RefNannyFinishContext();
17148 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17149 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17150 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17151 PyObject *__pyx_r = 0;
17152 __Pyx_RefNannyDeclarations
17153 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17154 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17157 __Pyx_RefNannyFinishContext();
17161 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17162 PyObject *__pyx_r = NULL;
17163 __Pyx_TraceDeclarations
17164 __Pyx_RefNannyDeclarations
17165 PyObject *__pyx_t_1 = NULL;
17166 int __pyx_lineno = 0;
17167 const char *__pyx_filename = NULL;
17168 int __pyx_clineno = 0;
17169 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17170 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17178 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
17179 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17180 __Pyx_GOTREF(__pyx_t_1);
17181 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17183 __PYX_ERR(1, 2, __pyx_L1_error)
17193 __Pyx_XDECREF(__pyx_t_1);
17194 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17196 __Pyx_XGIVEREF(__pyx_r);
17197 __Pyx_TraceReturn(__pyx_r, 0);
17198 __Pyx_RefNannyFinishContext();
17210 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17211 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17212 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17213 PyObject *__pyx_r = 0;
17214 __Pyx_RefNannyDeclarations
17215 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17216 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17219 __Pyx_RefNannyFinishContext();
17223 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17224 PyObject *__pyx_r = NULL;
17225 __Pyx_TraceDeclarations
17226 __Pyx_RefNannyDeclarations
17227 PyObject *__pyx_t_1 = NULL;
17228 int __pyx_lineno = 0;
17229 const char *__pyx_filename = NULL;
17230 int __pyx_clineno = 0;
17231 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17232 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17239 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
17240 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17241 __Pyx_GOTREF(__pyx_t_1);
17242 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17243 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17244 __PYX_ERR(1, 4, __pyx_L1_error)
17255 __Pyx_XDECREF(__pyx_t_1);
17256 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17258 __Pyx_XGIVEREF(__pyx_r);
17259 __Pyx_TraceReturn(__pyx_r, 0);
17260 __Pyx_RefNannyFinishContext();
17272 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17273 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17274 Py_ssize_t __pyx_v_suboffset;
17275 PyObject *__pyx_v_length = NULL;
17276 PyObject *__pyx_r = NULL;
17277 __Pyx_TraceDeclarations
17278 __Pyx_RefNannyDeclarations
17280 PyObject *__pyx_t_2 = NULL;
17281 PyObject *__pyx_t_3 = NULL;
17282 __Pyx_TypeInfo *__pyx_t_4;
17283 Py_buffer __pyx_t_5;
17284 Py_ssize_t *__pyx_t_6;
17285 Py_ssize_t *__pyx_t_7;
17286 Py_ssize_t *__pyx_t_8;
17287 Py_ssize_t __pyx_t_9;
17288 int __pyx_lineno = 0;
17289 const char *__pyx_filename = NULL;
17290 int __pyx_clineno = 0;
17291 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17292 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
17301 __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
17302 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17312 __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
17313 __Pyx_XDECREF(__pyx_r);
17314 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17333 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
17334 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17335 __Pyx_GOTREF(__pyx_t_2);
17336 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
17337 __Pyx_GOTREF(__pyx_t_3);
17338 __Pyx_INCREF(Py_None);
17339 __Pyx_GIVEREF(Py_None);
17340 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17341 __Pyx_INCREF(__pyx_int_0);
17342 __Pyx_GIVEREF(__pyx_int_0);
17343 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17344 __Pyx_GIVEREF(__pyx_t_2);
17345 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17347 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
17348 __Pyx_GOTREF(__pyx_t_2);
17349 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17350 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17360 __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
17361 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17370 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
17371 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17380 __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
17381 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
17382 __Pyx_GOTREF(__pyx_t_2);
17383 __Pyx_GIVEREF(__pyx_t_2);
17384 __Pyx_GOTREF(__pyx_v_result->from_object);
17385 __Pyx_DECREF(__pyx_v_result->from_object);
17386 __pyx_v_result->from_object = __pyx_t_2;
17396 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
17397 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17398 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17407 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
17408 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17409 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17418 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
17419 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17428 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
17429 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17438 __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
17439 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17448 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
17449 Py_INCREF(Py_None);
17458 __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
17459 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17469 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
17470 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17489 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
17491 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17502 __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
17503 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17512 __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
17513 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17522 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
17523 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17532 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
17533 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17534 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17535 __pyx_t_6 = __pyx_t_8;
17536 __pyx_v_suboffset = (__pyx_t_6[0]);
17545 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
17546 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17556 __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
17557 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17566 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
17567 goto __pyx_L6_break;
17587 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
17588 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17589 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17598 __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
17599 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17600 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17601 __pyx_t_6 = __pyx_t_8;
17602 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
17603 __Pyx_GOTREF(__pyx_t_2);
17604 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17614 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
17615 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
17616 __Pyx_GOTREF(__pyx_t_2);
17617 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
17618 __Pyx_GOTREF(__pyx_t_3);
17619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17620 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
17621 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17622 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17632 __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
17633 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17642 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
17643 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17652 __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
17653 __Pyx_XDECREF(__pyx_r);
17654 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17655 __pyx_r = ((PyObject *)__pyx_v_result);
17668 __Pyx_XDECREF(__pyx_t_2);
17669 __Pyx_XDECREF(__pyx_t_3);
17670 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17673 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17674 __Pyx_XDECREF(__pyx_v_length);
17675 __Pyx_XGIVEREF(__pyx_r);
17676 __Pyx_TraceReturn(__pyx_r, 0);
17677 __Pyx_RefNannyFinishContext();
17689 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17690 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17691 __Pyx_memviewslice *__pyx_r;
17692 __Pyx_TraceDeclarations
17693 __Pyx_RefNannyDeclarations
17696 PyObject *__pyx_t_3 = NULL;
17697 int __pyx_lineno = 0;
17698 const char *__pyx_filename = NULL;
17699 int __pyx_clineno = 0;
17700 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17701 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
17710 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17711 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17712 __pyx_t_2 = (__pyx_t_1 != 0);
17722 __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
17723 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
17724 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17725 __Pyx_INCREF(__pyx_t_3);
17726 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17736 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17737 __pyx_r = (&__pyx_v_obj->from_slice);
17756 __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
17758 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17767 __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
17768 __pyx_r = __pyx_v_mslice;
17782 __Pyx_XDECREF(__pyx_t_3);
17783 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17786 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17787 __Pyx_TraceReturn(Py_None, 0);
17788 __Pyx_RefNannyFinishContext();
17800 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17802 Py_ssize_t *__pyx_v_shape;
17803 Py_ssize_t *__pyx_v_strides;
17804 Py_ssize_t *__pyx_v_suboffsets;
17805 __Pyx_TraceDeclarations
17806 __Pyx_RefNannyDeclarations
17807 Py_ssize_t *__pyx_t_1;
17811 Py_ssize_t __pyx_t_5;
17812 int __pyx_lineno = 0;
17813 const char *__pyx_filename = NULL;
17814 int __pyx_clineno = 0;
17815 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17816 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
17825 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17826 __pyx_t_1 = __pyx_v_memview->view.shape;
17827 __pyx_v_shape = __pyx_t_1;
17836 __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
17837 __pyx_t_1 = __pyx_v_memview->view.strides;
17838 __pyx_v_strides = __pyx_t_1;
17847 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17848 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17849 __pyx_v_suboffsets = __pyx_t_1;
17858 __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
17859 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17868 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17869 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17878 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17879 __pyx_t_2 = __pyx_v_memview->view.ndim;
17880 __pyx_t_3 = __pyx_t_2;
17881 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17882 __pyx_v_dim = __pyx_t_4;
17891 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17892 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17901 __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
17902 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17911 __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
17912 if ((__pyx_v_suboffsets != 0)) {
17913 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17917 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17931 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17933 __Pyx_TraceReturn(Py_None, 0);
17934 __Pyx_RefNannyFinishContext();
17945 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17946 __Pyx_memviewslice __pyx_v_memviewslice;
17947 PyObject *__pyx_r = NULL;
17948 __Pyx_TraceDeclarations
17949 __Pyx_RefNannyDeclarations
17950 PyObject *__pyx_t_1 = NULL;
17951 int __pyx_lineno = 0;
17952 const char *__pyx_filename = NULL;
17953 int __pyx_clineno = 0;
17954 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17955 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
17964 __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
17965 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17974 __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
17975 __Pyx_XDECREF(__pyx_r);
17976 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
17977 __Pyx_GOTREF(__pyx_t_1);
17978 __pyx_r = __pyx_t_1;
17992 __Pyx_XDECREF(__pyx_t_1);
17993 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17996 __Pyx_XGIVEREF(__pyx_r);
17997 __Pyx_TraceReturn(__pyx_r, 0);
17998 __Pyx_RefNannyFinishContext();
18010 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18011 PyObject *(*__pyx_v_to_object_func)(
char *);
18012 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18013 PyObject *__pyx_r = NULL;
18014 __Pyx_TraceDeclarations
18015 __Pyx_RefNannyDeclarations
18018 PyObject *(*__pyx_t_3)(
char *);
18019 int (*__pyx_t_4)(
char *, PyObject *);
18020 PyObject *__pyx_t_5 = NULL;
18021 int __pyx_lineno = 0;
18022 const char *__pyx_filename = NULL;
18023 int __pyx_clineno = 0;
18024 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18025 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
18034 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
18035 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18036 __pyx_t_2 = (__pyx_t_1 != 0);
18046 __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
18047 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18048 __pyx_v_to_object_func = __pyx_t_3;
18057 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
18058 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18059 __pyx_v_to_dtype_func = __pyx_t_4;
18078 __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
18080 __pyx_v_to_object_func = NULL;
18089 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
18090 __pyx_v_to_dtype_func = NULL;
18101 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
18102 __Pyx_XDECREF(__pyx_r);
18111 __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
18112 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
18113 __Pyx_GOTREF(__pyx_t_5);
18114 __pyx_r = __pyx_t_5;
18128 __Pyx_XDECREF(__pyx_t_5);
18129 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18132 __Pyx_XGIVEREF(__pyx_r);
18133 __Pyx_TraceReturn(__pyx_r, 0);
18134 __Pyx_RefNannyFinishContext();
18146 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18147 Py_ssize_t __pyx_r;
18148 __Pyx_TraceDeclarations
18150 int __pyx_lineno = 0;
18151 const char *__pyx_filename = NULL;
18152 int __pyx_clineno = 0;
18153 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
18162 __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
18163 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18173 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
18174 __pyx_r = (-__pyx_v_arg);
18193 __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
18195 __pyx_r = __pyx_v_arg;
18209 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18212 __Pyx_TraceReturn(Py_None, 1);
18224 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18226 Py_ssize_t __pyx_v_c_stride;
18227 Py_ssize_t __pyx_v_f_stride;
18229 __Pyx_TraceDeclarations
18234 int __pyx_lineno = 0;
18235 const char *__pyx_filename = NULL;
18236 int __pyx_clineno = 0;
18237 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
18246 __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
18247 __pyx_v_c_stride = 0;
18256 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
18257 __pyx_v_f_stride = 0;
18266 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
18267 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18268 __pyx_v_i = __pyx_t_1;
18277 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
18278 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18288 __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
18289 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18298 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
18299 goto __pyx_L4_break;
18319 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
18320 __pyx_t_1 = __pyx_v_ndim;
18321 __pyx_t_3 = __pyx_t_1;
18322 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18323 __pyx_v_i = __pyx_t_4;
18332 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
18333 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18343 __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
18344 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18353 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
18354 goto __pyx_L7_break;
18374 __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
18375 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18385 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
18405 __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
18421 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18424 __Pyx_TraceReturn(Py_None, 1);
18436 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18437 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18438 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18439 Py_ssize_t __pyx_v_dst_extent;
18440 Py_ssize_t __pyx_v_src_stride;
18441 Py_ssize_t __pyx_v_dst_stride;
18445 Py_ssize_t __pyx_t_4;
18446 Py_ssize_t __pyx_t_5;
18447 Py_ssize_t __pyx_t_6;
18456 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18465 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18474 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18483 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18492 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18502 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18505 __pyx_t_1 = __pyx_t_2;
18506 goto __pyx_L5_bool_binop_done;
18508 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18511 __pyx_t_1 = __pyx_t_2;
18512 goto __pyx_L5_bool_binop_done;
18522 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18524 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18526 __pyx_t_3 = (__pyx_t_2 != 0);
18527 __pyx_t_1 = __pyx_t_3;
18528 __pyx_L5_bool_binop_done:;
18546 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18566 __pyx_t_4 = __pyx_v_dst_extent;
18567 __pyx_t_5 = __pyx_t_4;
18568 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18569 __pyx_v_i = __pyx_t_6;
18578 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18587 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18596 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18619 __pyx_t_4 = __pyx_v_dst_extent;
18620 __pyx_t_5 = __pyx_t_4;
18621 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18622 __pyx_v_i = __pyx_t_6;
18631 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18640 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18649 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18673 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18674 __Pyx_TraceDeclarations
18675 int __pyx_lineno = 0;
18676 const char *__pyx_filename = NULL;
18677 int __pyx_clineno = 0;
18678 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
18687 __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
18688 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18701 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18703 __Pyx_TraceReturn(Py_None, 1);
18714 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18715 Py_ssize_t __pyx_v_shape;
18716 Py_ssize_t __pyx_v_size;
18717 Py_ssize_t __pyx_r;
18718 __Pyx_TraceDeclarations
18719 Py_ssize_t __pyx_t_1;
18720 Py_ssize_t *__pyx_t_2;
18721 Py_ssize_t *__pyx_t_3;
18722 Py_ssize_t *__pyx_t_4;
18723 int __pyx_lineno = 0;
18724 const char *__pyx_filename = NULL;
18725 int __pyx_clineno = 0;
18726 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
18735 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18736 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18737 __pyx_v_size = __pyx_t_1;
18746 __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
18747 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18748 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18749 __pyx_t_2 = __pyx_t_4;
18750 __pyx_v_shape = (__pyx_t_2[0]);
18759 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18760 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18770 __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
18771 __pyx_r = __pyx_v_size;
18784 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18787 __Pyx_TraceReturn(Py_None, 1);
18799 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18801 Py_ssize_t __pyx_r;
18802 __Pyx_TraceDeclarations
18807 int __pyx_lineno = 0;
18808 const char *__pyx_filename = NULL;
18809 int __pyx_clineno = 0;
18810 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
18819 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18820 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18830 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18831 __pyx_t_2 = __pyx_v_ndim;
18832 __pyx_t_3 = __pyx_t_2;
18833 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18834 __pyx_v_idx = __pyx_t_4;
18843 __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
18844 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18853 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18854 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18874 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18876 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18877 __pyx_v_idx = __pyx_t_2;
18886 __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
18887 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18896 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18897 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18909 __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
18910 __pyx_r = __pyx_v_stride;
18923 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18926 __Pyx_TraceReturn(Py_None, 1);
18938 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18940 void *__pyx_v_result;
18941 size_t __pyx_v_itemsize;
18942 size_t __pyx_v_size;
18944 __Pyx_TraceDeclarations
18945 Py_ssize_t __pyx_t_1;
18948 struct __pyx_memoryview_obj *__pyx_t_4;
18951 int __pyx_lineno = 0;
18952 const char *__pyx_filename = NULL;
18953 int __pyx_clineno = 0;
18954 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
18963 __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
18964 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18965 __pyx_v_itemsize = __pyx_t_1;
18974 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18975 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18984 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18985 __pyx_v_result = malloc(__pyx_v_size);
18994 __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
18995 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19005 __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
19006 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
19024 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
19025 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19034 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
19035 __pyx_t_4 = __pyx_v_src->memview;
19036 __pyx_v_tmpslice->memview = __pyx_t_4;
19045 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
19046 __pyx_t_3 = __pyx_v_ndim;
19047 __pyx_t_5 = __pyx_t_3;
19048 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19049 __pyx_v_i = __pyx_t_6;
19058 __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
19059 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19068 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
19069 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19079 __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
19080 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19089 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
19090 __pyx_t_3 = __pyx_v_ndim;
19091 __pyx_t_5 = __pyx_t_3;
19092 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19093 __pyx_v_i = __pyx_t_6;
19102 __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
19103 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19113 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
19114 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19133 __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
19134 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19144 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
19145 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19164 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
19166 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19177 __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
19178 __pyx_r = __pyx_v_result;
19193 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19195 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19197 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19202 __Pyx_TraceReturn(Py_None, 1);
19214 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19216 __Pyx_TraceDeclarations
19217 __Pyx_RefNannyDeclarations
19218 PyObject *__pyx_t_1 = NULL;
19219 PyObject *__pyx_t_2 = NULL;
19220 PyObject *__pyx_t_3 = NULL;
19221 PyObject *__pyx_t_4 = NULL;
19222 int __pyx_lineno = 0;
19223 const char *__pyx_filename = NULL;
19224 int __pyx_clineno = 0;
19226 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19228 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19229 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
19238 __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
19239 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
19240 __Pyx_GOTREF(__pyx_t_1);
19241 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
19242 __Pyx_GOTREF(__pyx_t_2);
19243 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
19244 __Pyx_GOTREF(__pyx_t_3);
19245 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
19246 __Pyx_GOTREF(__pyx_t_4);
19247 __Pyx_GIVEREF(__pyx_t_1);
19248 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19249 __Pyx_GIVEREF(__pyx_t_2);
19250 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19251 __Pyx_GIVEREF(__pyx_t_3);
19252 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19264 __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
19265 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
19266 __Pyx_GOTREF(__pyx_t_3);
19267 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19268 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
19269 __Pyx_GOTREF(__pyx_t_4);
19270 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19271 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19272 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19273 __PYX_ERR(1, 1255, __pyx_L1_error)
19285 __Pyx_XDECREF(__pyx_t_1);
19286 __Pyx_XDECREF(__pyx_t_2);
19287 __Pyx_XDECREF(__pyx_t_3);
19288 __Pyx_XDECREF(__pyx_t_4);
19289 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19291 __Pyx_TraceReturn(Py_None, 0);
19292 __Pyx_RefNannyFinishContext();
19294 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19307 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19309 __Pyx_TraceDeclarations
19310 __Pyx_RefNannyDeclarations
19311 PyObject *__pyx_t_1 = NULL;
19312 PyObject *__pyx_t_2 = NULL;
19313 PyObject *__pyx_t_3 = NULL;
19314 PyObject *__pyx_t_4 = NULL;
19315 int __pyx_lineno = 0;
19316 const char *__pyx_filename = NULL;
19317 int __pyx_clineno = 0;
19319 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19321 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19322 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
19323 __Pyx_INCREF(__pyx_v_error);
19332 __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
19333 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
19334 __Pyx_GOTREF(__pyx_t_2);
19335 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
19336 __Pyx_GOTREF(__pyx_t_3);
19337 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
19338 __Pyx_GOTREF(__pyx_t_4);
19339 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19340 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19341 __Pyx_INCREF(__pyx_v_error);
19342 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19343 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19344 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19345 if (likely(__pyx_t_2)) {
19346 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19347 __Pyx_INCREF(__pyx_t_2);
19348 __Pyx_INCREF(
function);
19349 __Pyx_DECREF_SET(__pyx_t_3,
function);
19352 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19353 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19354 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19355 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
19356 __Pyx_GOTREF(__pyx_t_1);
19357 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19358 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19360 __PYX_ERR(1, 1260, __pyx_L1_error)
19372 __Pyx_XDECREF(__pyx_t_1);
19373 __Pyx_XDECREF(__pyx_t_2);
19374 __Pyx_XDECREF(__pyx_t_3);
19375 __Pyx_XDECREF(__pyx_t_4);
19376 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19378 __Pyx_XDECREF(__pyx_v_error);
19379 __Pyx_TraceReturn(Py_None, 0);
19380 __Pyx_RefNannyFinishContext();
19382 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19395 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19397 __Pyx_TraceDeclarations
19398 __Pyx_RefNannyDeclarations
19400 PyObject *__pyx_t_2 = NULL;
19401 PyObject *__pyx_t_3 = NULL;
19402 PyObject *__pyx_t_4 = NULL;
19403 PyObject *__pyx_t_5 = NULL;
19404 int __pyx_lineno = 0;
19405 const char *__pyx_filename = NULL;
19406 int __pyx_clineno = 0;
19408 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19410 __Pyx_RefNannySetupContext(
"_err", 0);
19411 __Pyx_TraceCall(
"_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
19412 __Pyx_INCREF(__pyx_v_error);
19421 __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
19422 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19423 if (unlikely(__pyx_t_1)) {
19432 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
19433 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
19434 __Pyx_GOTREF(__pyx_t_3);
19435 __Pyx_INCREF(__pyx_v_error);
19436 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19437 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19438 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19439 if (likely(__pyx_t_5)) {
19440 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19441 __Pyx_INCREF(__pyx_t_5);
19442 __Pyx_INCREF(
function);
19443 __Pyx_DECREF_SET(__pyx_t_4,
function);
19446 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19447 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19448 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19449 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
19450 __Pyx_GOTREF(__pyx_t_2);
19451 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19452 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19453 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19454 __PYX_ERR(1, 1265, __pyx_L1_error)
19472 __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
19474 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19475 __PYX_ERR(1, 1267, __pyx_L1_error)
19488 __Pyx_XDECREF(__pyx_t_2);
19489 __Pyx_XDECREF(__pyx_t_3);
19490 __Pyx_XDECREF(__pyx_t_4);
19491 __Pyx_XDECREF(__pyx_t_5);
19492 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19494 __Pyx_XDECREF(__pyx_v_error);
19495 __Pyx_TraceReturn(Py_None, 0);
19496 __Pyx_RefNannyFinishContext();
19498 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19511 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19512 void *__pyx_v_tmpdata;
19513 size_t __pyx_v_itemsize;
19515 char __pyx_v_order;
19516 int __pyx_v_broadcasting;
19517 int __pyx_v_direct_copy;
19518 __Pyx_memviewslice __pyx_v_tmp;
19521 __Pyx_TraceDeclarations
19522 Py_ssize_t __pyx_t_1;
19530 int __pyx_lineno = 0;
19531 const char *__pyx_filename = NULL;
19532 int __pyx_clineno = 0;
19533 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
19542 __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
19543 __pyx_v_tmpdata = NULL;
19552 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
19553 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19554 __pyx_v_itemsize = __pyx_t_1;
19563 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
19564 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19573 __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
19574 __pyx_v_broadcasting = 0;
19583 __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
19584 __pyx_v_direct_copy = 0;
19593 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
19594 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19604 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
19605 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19624 __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
19625 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19635 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
19636 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19655 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
19656 __pyx_t_3 = __pyx_v_dst_ndim;
19657 __pyx_t_4 = __pyx_v_src_ndim;
19658 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19659 __pyx_t_5 = __pyx_t_3;
19661 __pyx_t_5 = __pyx_t_4;
19663 __pyx_v_ndim = __pyx_t_5;
19672 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
19673 __pyx_t_5 = __pyx_v_ndim;
19674 __pyx_t_3 = __pyx_t_5;
19675 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19676 __pyx_v_i = __pyx_t_4;
19685 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
19686 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19696 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19697 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19707 __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
19708 __pyx_v_broadcasting = 1;
19717 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19718 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19737 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19739 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
19759 __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
19760 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19770 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19771 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
19790 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19791 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19801 __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
19802 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19812 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19813 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19831 __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
19832 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
19833 __pyx_v_tmpdata = __pyx_t_7;
19842 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19843 __pyx_v_src = __pyx_v_tmp;
19861 __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
19862 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19872 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19873 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19883 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19884 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19903 __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
19904 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19914 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19915 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19934 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19935 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19945 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19946 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19955 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19956 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19965 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19966 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19975 __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
19976 free(__pyx_v_tmpdata);
19985 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
20014 __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
20015 __pyx_t_2 = (__pyx_v_order ==
'F');
20017 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20019 __pyx_t_8 = (__pyx_t_2 != 0);
20029 __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
20030 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
20039 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
20040 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
20058 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
20059 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20068 __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
20069 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20078 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
20079 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20088 __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
20089 free(__pyx_v_tmpdata);
20098 __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
20114 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20116 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20118 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20123 __Pyx_TraceReturn(Py_None, 1);
20135 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20137 int __pyx_v_offset;
20138 __Pyx_TraceDeclarations
20142 int __pyx_lineno = 0;
20143 const char *__pyx_filename = NULL;
20144 int __pyx_clineno = 0;
20145 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
20154 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
20155 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20164 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
20165 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20166 __pyx_v_i = __pyx_t_1;
20175 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
20176 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20185 __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
20186 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20195 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
20196 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20206 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
20207 __pyx_t_1 = __pyx_v_offset;
20208 __pyx_t_2 = __pyx_t_1;
20209 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20210 __pyx_v_i = __pyx_t_3;
20219 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
20220 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20229 __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
20230 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20239 __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
20240 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20254 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20256 __Pyx_TraceReturn(Py_None, 1);
20267 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20268 __Pyx_TraceDeclarations
20270 int __pyx_lineno = 0;
20271 const char *__pyx_filename = NULL;
20272 int __pyx_clineno = 0;
20273 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
20282 __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
20283 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20293 __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
20294 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20316 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20318 __Pyx_TraceReturn(Py_None, 1);
20329 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20330 __Pyx_TraceDeclarations
20331 __Pyx_RefNannyDeclarations
20332 int __pyx_lineno = 0;
20333 const char *__pyx_filename = NULL;
20334 int __pyx_clineno = 0;
20336 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20338 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20339 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
20348 __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
20349 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20362 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20364 __Pyx_TraceReturn(Py_None, 0);
20365 __Pyx_RefNannyFinishContext();
20367 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20379 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20380 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20381 __Pyx_TraceDeclarations
20382 __Pyx_RefNannyDeclarations
20383 Py_ssize_t __pyx_t_1;
20384 Py_ssize_t __pyx_t_2;
20385 Py_ssize_t __pyx_t_3;
20387 int __pyx_lineno = 0;
20388 const char *__pyx_filename = NULL;
20389 int __pyx_clineno = 0;
20390 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20391 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
20400 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
20401 __pyx_t_1 = (__pyx_v_shape[0]);
20402 __pyx_t_2 = __pyx_t_1;
20403 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20404 __pyx_v_i = __pyx_t_3;
20413 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
20414 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20424 __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
20425 __pyx_t_4 = (__pyx_v_inc != 0);
20435 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
20436 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20455 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
20457 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20478 __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
20488 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
20489 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20500 __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
20501 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20515 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20517 __Pyx_TraceReturn(Py_None, 0);
20518 __Pyx_RefNannyFinishContext();
20529 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20530 __Pyx_TraceDeclarations
20531 int __pyx_lineno = 0;
20532 const char *__pyx_filename = NULL;
20533 int __pyx_clineno = 0;
20534 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
20543 __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
20544 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20553 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
20554 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20563 __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
20564 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20577 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20579 __Pyx_TraceReturn(Py_None, 1);
20590 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20591 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20592 Py_ssize_t __pyx_v_stride;
20593 Py_ssize_t __pyx_v_extent;
20594 __Pyx_TraceDeclarations
20596 Py_ssize_t __pyx_t_2;
20597 Py_ssize_t __pyx_t_3;
20598 Py_ssize_t __pyx_t_4;
20599 int __pyx_lineno = 0;
20600 const char *__pyx_filename = NULL;
20601 int __pyx_clineno = 0;
20602 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
20611 __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
20612 __pyx_v_stride = (__pyx_v_strides[0]);
20621 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
20622 __pyx_v_extent = (__pyx_v_shape[0]);
20631 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
20632 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20642 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
20643 __pyx_t_2 = __pyx_v_extent;
20644 __pyx_t_3 = __pyx_t_2;
20645 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20646 __pyx_v_i = __pyx_t_4;
20655 __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
20656 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20665 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
20666 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20686 __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
20688 __pyx_t_2 = __pyx_v_extent;
20689 __pyx_t_3 = __pyx_t_2;
20690 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20691 __pyx_v_i = __pyx_t_4;
20700 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20701 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20710 __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
20711 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20727 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20729 __Pyx_TraceReturn(Py_None, 1);
20739 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20740 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20741 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20742 PyObject *__pyx_v___pyx_type = 0;
20743 long __pyx_v___pyx_checksum;
20744 PyObject *__pyx_v___pyx_state = 0;
20745 int __pyx_lineno = 0;
20746 const char *__pyx_filename = NULL;
20747 int __pyx_clineno = 0;
20748 PyObject *__pyx_r = 0;
20749 __Pyx_RefNannyDeclarations
20750 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20752 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20753 PyObject* values[3] = {0,0,0};
20754 if (unlikely(__pyx_kwds)) {
20755 Py_ssize_t kw_args;
20756 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20757 switch (pos_args) {
20758 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20759 CYTHON_FALLTHROUGH;
20760 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20761 CYTHON_FALLTHROUGH;
20762 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20763 CYTHON_FALLTHROUGH;
20765 default:
goto __pyx_L5_argtuple_error;
20767 kw_args = PyDict_Size(__pyx_kwds);
20768 switch (pos_args) {
20770 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20771 else goto __pyx_L5_argtuple_error;
20772 CYTHON_FALLTHROUGH;
20774 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20776 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20778 CYTHON_FALLTHROUGH;
20780 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20782 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20785 if (unlikely(kw_args > 0)) {
20786 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20788 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20789 goto __pyx_L5_argtuple_error;
20791 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20792 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20793 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20795 __pyx_v___pyx_type = values[0];
20796 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20797 __pyx_v___pyx_state = values[2];
20799 goto __pyx_L4_argument_unpacking_done;
20800 __pyx_L5_argtuple_error:;
20801 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20803 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20804 __Pyx_RefNannyFinishContext();
20806 __pyx_L4_argument_unpacking_done:;
20807 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20810 __Pyx_RefNannyFinishContext();
20814 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20815 PyObject *__pyx_v___pyx_PickleError = 0;
20816 PyObject *__pyx_v___pyx_result = 0;
20817 PyObject *__pyx_r = NULL;
20818 __Pyx_TraceDeclarations
20819 __Pyx_RefNannyDeclarations
20820 PyObject *__pyx_t_1 = NULL;
20823 PyObject *__pyx_t_4 = NULL;
20824 PyObject *__pyx_t_5 = NULL;
20825 PyObject *__pyx_t_6 = NULL;
20826 int __pyx_lineno = 0;
20827 const char *__pyx_filename = NULL;
20828 int __pyx_clineno = 0;
20829 __Pyx_TraceFrameInit(__pyx_codeobj__36)
20830 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20831 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20840 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20841 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20842 __Pyx_GOTREF(__pyx_t_1);
20843 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__37, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20845 __pyx_t_3 = (__pyx_t_2 != 0);
20855 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20856 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20857 __Pyx_GOTREF(__pyx_t_1);
20858 __Pyx_INCREF(__pyx_n_s_PickleError);
20859 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20860 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20861 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20862 __Pyx_GOTREF(__pyx_t_4);
20863 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20864 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20865 __Pyx_GOTREF(__pyx_t_1);
20866 __Pyx_INCREF(__pyx_t_1);
20867 __pyx_v___pyx_PickleError = __pyx_t_1;
20868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20869 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20878 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20879 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20880 __Pyx_GOTREF(__pyx_t_1);
20881 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20882 __Pyx_GOTREF(__pyx_t_5);
20883 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20884 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20885 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20886 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20887 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20888 if (likely(__pyx_t_6)) {
20889 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20890 __Pyx_INCREF(__pyx_t_6);
20891 __Pyx_INCREF(
function);
20892 __Pyx_DECREF_SET(__pyx_t_1,
function);
20895 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
20896 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20897 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20898 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20899 __Pyx_GOTREF(__pyx_t_4);
20900 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20901 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20902 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20903 __PYX_ERR(1, 6, __pyx_L1_error)
20921 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20922 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20923 __Pyx_GOTREF(__pyx_t_1);
20925 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20926 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20927 if (likely(__pyx_t_5)) {
20928 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20929 __Pyx_INCREF(__pyx_t_5);
20930 __Pyx_INCREF(
function);
20931 __Pyx_DECREF_SET(__pyx_t_1,
function);
20934 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
20935 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20936 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20937 __Pyx_GOTREF(__pyx_t_4);
20938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20939 __pyx_v___pyx_result = __pyx_t_4;
20949 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20950 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20951 __pyx_t_2 = (__pyx_t_3 != 0);
20961 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20962 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20963 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20964 __Pyx_GOTREF(__pyx_t_4);
20965 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20983 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20984 __Pyx_XDECREF(__pyx_r);
20985 __Pyx_INCREF(__pyx_v___pyx_result);
20986 __pyx_r = __pyx_v___pyx_result;
20997 __Pyx_XDECREF(__pyx_t_1);
20998 __Pyx_XDECREF(__pyx_t_4);
20999 __Pyx_XDECREF(__pyx_t_5);
21000 __Pyx_XDECREF(__pyx_t_6);
21001 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21004 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21005 __Pyx_XDECREF(__pyx_v___pyx_result);
21006 __Pyx_XGIVEREF(__pyx_r);
21007 __Pyx_TraceReturn(__pyx_r, 0);
21008 __Pyx_RefNannyFinishContext();
21020 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21021 PyObject *__pyx_r = NULL;
21022 __Pyx_TraceDeclarations
21023 __Pyx_RefNannyDeclarations
21024 PyObject *__pyx_t_1 = NULL;
21026 Py_ssize_t __pyx_t_3;
21029 PyObject *__pyx_t_6 = NULL;
21030 PyObject *__pyx_t_7 = NULL;
21031 PyObject *__pyx_t_8 = NULL;
21032 int __pyx_lineno = 0;
21033 const char *__pyx_filename = NULL;
21034 int __pyx_clineno = 0;
21035 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
21036 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21045 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
21046 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21047 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21048 __PYX_ERR(1, 12, __pyx_L1_error)
21050 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21051 __Pyx_GOTREF(__pyx_t_1);
21052 __Pyx_GIVEREF(__pyx_t_1);
21053 __Pyx_GOTREF(__pyx_v___pyx_result->name);
21054 __Pyx_DECREF(__pyx_v___pyx_result->name);
21055 __pyx_v___pyx_result->name = __pyx_t_1;
21064 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
21065 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21066 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
21067 __PYX_ERR(1, 13, __pyx_L1_error)
21069 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21070 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21073 __pyx_t_2 = __pyx_t_4;
21074 goto __pyx_L4_bool_binop_done;
21076 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21077 __pyx_t_5 = (__pyx_t_4 != 0);
21078 __pyx_t_2 = __pyx_t_5;
21079 __pyx_L4_bool_binop_done:;
21087 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
21088 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21089 __Pyx_GOTREF(__pyx_t_6);
21090 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21091 __Pyx_GOTREF(__pyx_t_7);
21092 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21093 if (unlikely(__pyx_v___pyx_state == Py_None)) {
21094 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21095 __PYX_ERR(1, 14, __pyx_L1_error)
21097 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21098 __Pyx_GOTREF(__pyx_t_6);
21100 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21101 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21102 if (likely(__pyx_t_8)) {
21103 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21104 __Pyx_INCREF(__pyx_t_8);
21105 __Pyx_INCREF(
function);
21106 __Pyx_DECREF_SET(__pyx_t_7,
function);
21109 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
21110 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21111 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21112 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21113 __Pyx_GOTREF(__pyx_t_1);
21114 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21115 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21134 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21137 __Pyx_XDECREF(__pyx_t_1);
21138 __Pyx_XDECREF(__pyx_t_6);
21139 __Pyx_XDECREF(__pyx_t_7);
21140 __Pyx_XDECREF(__pyx_t_8);
21141 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21144 __Pyx_XGIVEREF(__pyx_r);
21145 __Pyx_TraceReturn(__pyx_r, 0);
21146 __Pyx_RefNannyFinishContext();
21149 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21151 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
21152 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p;
21153 PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
21154 if (unlikely(!o))
return 0;
21155 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o);
21156 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
21157 p->A_csr = Py_None; Py_INCREF(Py_None);
21158 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21159 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21160 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(o, a, k) < 0))
goto bad;
21163 Py_DECREF(o); o = 0;
21167 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21168 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21169 #if CYTHON_USE_TP_FINALIZE
21170 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21171 if (PyObject_CallFinalizerFromDealloc(o))
return;
21174 PyObject_GC_UnTrack(o);
21175 Py_CLEAR(p->A_csr);
21176 Py_CLEAR(p->A_indices_copy);
21177 Py_CLEAR(p->A_index_pointer_copy);
21178 PyObject_GC_Track(o);
21179 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o);
else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21182 static int __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o, visitproc v,
void *a) {
21184 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21185 e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix));
if (e)
return e;
21187 e = (*v)(p->A_csr, a);
if (e)
return e;
21189 if (p->A_indices_copy) {
21190 e = (*v)(p->A_indices_copy, a);
if (e)
return e;
21192 if (p->A_index_pointer_copy) {
21193 e = (*v)(p->A_index_pointer_copy, a);
if (e)
return e;
21198 static int __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
21200 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
21201 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) {
if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); }
else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
21202 tmp = ((PyObject*)p->A_csr);
21203 p->A_csr = Py_None; Py_INCREF(Py_None);
21205 tmp = ((PyObject*)p->A_indices_copy);
21206 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
21208 tmp = ((PyObject*)p->A_index_pointer_copy);
21209 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
21214 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix[] = {
21215 {
"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float},
21216 {
"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double},
21217 {
"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double},
21218 {
"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float},
21219 {
"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double},
21220 {
"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double},
21221 {
"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float},
21222 {
"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double},
21223 {
"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double},
21224 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__},
21225 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__},
21229 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = {
21230 PyVarObject_HEAD_INIT(0, 0)
21231 "imate._c_linear_operator.py_c_matrix.pycMatrix",
21232 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix),
21234 __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21235 #
if PY_VERSION_HEX < 0x030800b4
21238 #
if PY_VERSION_HEX >= 0x030800b4
21243 #
if PY_MAJOR_VERSION < 3
21246 #
if PY_MAJOR_VERSION >= 3
21259 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21260 "\n Defines a linear operator that is a constant matrix.\n\n **Initializing Object:**\n\n The object is initialized by a given matrix :math:`\\mathbf{A}` which can\n be a numpy array, or sparse matrices of any format (CSR, CSC, etc) using\n scipy sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrix of CSR format. Note the format of the input matrix\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n\n The following is an example of defining the operator with a dense matrix:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> cdef ConstantMatrix A = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do n""ot require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`AffineMatrixFunction`\n ",
21261 __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21262 __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21267 __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21277 __pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
21287 #
if PY_VERSION_HEX >= 0x030400a1
21290 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21293 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21296 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21300 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21302 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21303 struct __pyx_array_obj *p;
21305 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21306 o = (*t->tp_alloc)(t, 0);
21308 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21310 if (unlikely(!o))
return 0;
21311 p = ((
struct __pyx_array_obj *)o);
21312 p->__pyx_vtab = __pyx_vtabptr_array;
21313 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21314 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21315 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21318 Py_DECREF(o); o = 0;
21322 static void __pyx_tp_dealloc_array(PyObject *o) {
21323 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21324 #if CYTHON_USE_TP_FINALIZE
21325 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
21326 if (PyObject_CallFinalizerFromDealloc(o))
return;
21330 PyObject *etype, *eval, *etb;
21331 PyErr_Fetch(&etype, &eval, &etb);
21332 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21333 __pyx_array___dealloc__(o);
21334 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21335 PyErr_Restore(etype, eval, etb);
21338 Py_CLEAR(p->_format);
21339 (*Py_TYPE(o)->tp_free)(o);
21341 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21343 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21344 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21349 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21351 return __pyx_array___setitem__(o, i, v);
21354 PyErr_Format(PyExc_NotImplementedError,
21355 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21360 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21361 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21362 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21364 v = __pyx_array___getattr__(o, n);
21369 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21370 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21373 static PyMethodDef __pyx_methods_array[] = {
21374 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21375 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21376 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21380 static struct PyGetSetDef __pyx_getsets_array[] = {
21381 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21385 static PySequenceMethods __pyx_tp_as_sequence_array = {
21386 __pyx_array___len__,
21389 __pyx_sq_item_array,
21398 static PyMappingMethods __pyx_tp_as_mapping_array = {
21399 __pyx_array___len__,
21400 __pyx_array___getitem__,
21401 __pyx_mp_ass_subscript_array,
21404 static PyBufferProcs __pyx_tp_as_buffer_array = {
21405 #if PY_MAJOR_VERSION < 3
21408 #if PY_MAJOR_VERSION < 3
21411 #if PY_MAJOR_VERSION < 3
21414 #if PY_MAJOR_VERSION < 3
21417 __pyx_array_getbuffer,
21421 static PyTypeObject __pyx_type___pyx_array = {
21422 PyVarObject_HEAD_INIT(0, 0)
21423 "imate._c_linear_operator.py_c_matrix.array",
21424 sizeof(
struct __pyx_array_obj),
21426 __pyx_tp_dealloc_array,
21427 #
if PY_VERSION_HEX < 0x030800b4
21430 #
if PY_VERSION_HEX >= 0x030800b4
21435 #
if PY_MAJOR_VERSION < 3
21438 #
if PY_MAJOR_VERSION >= 3
21443 &__pyx_tp_as_sequence_array,
21444 &__pyx_tp_as_mapping_array,
21448 __pyx_tp_getattro_array,
21450 &__pyx_tp_as_buffer_array,
21451 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21459 __pyx_methods_array,
21461 __pyx_getsets_array,
21469 __pyx_tp_new_array,
21479 #
if PY_VERSION_HEX >= 0x030400a1
21482 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21485 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21488 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21493 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21494 struct __pyx_MemviewEnum_obj *p;
21496 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21497 o = (*t->tp_alloc)(t, 0);
21499 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21501 if (unlikely(!o))
return 0;
21502 p = ((
struct __pyx_MemviewEnum_obj *)o);
21503 p->name = Py_None; Py_INCREF(Py_None);
21507 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21508 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21509 #if CYTHON_USE_TP_FINALIZE
21510 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21511 if (PyObject_CallFinalizerFromDealloc(o))
return;
21514 PyObject_GC_UnTrack(o);
21516 (*Py_TYPE(o)->tp_free)(o);
21519 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
21521 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21523 e = (*v)(p->name, a);
if (e)
return e;
21528 static int __pyx_tp_clear_Enum(PyObject *o) {
21530 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21531 tmp = ((PyObject*)p->name);
21532 p->name = Py_None; Py_INCREF(Py_None);
21537 static PyMethodDef __pyx_methods_Enum[] = {
21538 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21539 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21543 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21544 PyVarObject_HEAD_INIT(0, 0)
21545 "imate._c_linear_operator.py_c_matrix.Enum",
21546 sizeof(
struct __pyx_MemviewEnum_obj),
21548 __pyx_tp_dealloc_Enum,
21549 #
if PY_VERSION_HEX < 0x030800b4
21552 #
if PY_VERSION_HEX >= 0x030800b4
21557 #
if PY_MAJOR_VERSION < 3
21560 #
if PY_MAJOR_VERSION >= 3
21563 __pyx_MemviewEnum___repr__,
21573 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21575 __pyx_tp_traverse_Enum,
21576 __pyx_tp_clear_Enum,
21581 __pyx_methods_Enum,
21589 __pyx_MemviewEnum___init__,
21601 #
if PY_VERSION_HEX >= 0x030400a1
21604 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21607 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21610 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21614 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21616 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21617 struct __pyx_memoryview_obj *p;
21619 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21620 o = (*t->tp_alloc)(t, 0);
21622 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21624 if (unlikely(!o))
return 0;
21625 p = ((
struct __pyx_memoryview_obj *)o);
21626 p->__pyx_vtab = __pyx_vtabptr_memoryview;
21627 p->obj = Py_None; Py_INCREF(Py_None);
21628 p->_size = Py_None; Py_INCREF(Py_None);
21629 p->_array_interface = Py_None; Py_INCREF(Py_None);
21630 p->view.obj = NULL;
21631 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
21634 Py_DECREF(o); o = 0;
21638 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21639 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21640 #if CYTHON_USE_TP_FINALIZE
21641 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21642 if (PyObject_CallFinalizerFromDealloc(o))
return;
21645 PyObject_GC_UnTrack(o);
21647 PyObject *etype, *eval, *etb;
21648 PyErr_Fetch(&etype, &eval, &etb);
21649 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21650 __pyx_memoryview___dealloc__(o);
21651 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21652 PyErr_Restore(etype, eval, etb);
21655 Py_CLEAR(p->_size);
21656 Py_CLEAR(p->_array_interface);
21657 (*Py_TYPE(o)->tp_free)(o);
21660 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
21662 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21664 e = (*v)(p->obj, a);
if (e)
return e;
21667 e = (*v)(p->_size, a);
if (e)
return e;
21669 if (p->_array_interface) {
21670 e = (*v)(p->_array_interface, a);
if (e)
return e;
21673 e = (*v)(p->view.obj, a);
if (e)
return e;
21678 static int __pyx_tp_clear_memoryview(PyObject *o) {
21680 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21681 tmp = ((PyObject*)p->obj);
21682 p->obj = Py_None; Py_INCREF(Py_None);
21684 tmp = ((PyObject*)p->_size);
21685 p->_size = Py_None; Py_INCREF(Py_None);
21687 tmp = ((PyObject*)p->_array_interface);
21688 p->_array_interface = Py_None; Py_INCREF(Py_None);
21690 Py_CLEAR(p->view.obj);
21693 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21695 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21696 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21701 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21703 return __pyx_memoryview___setitem__(o, i, v);
21706 PyErr_Format(PyExc_NotImplementedError,
21707 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21712 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21713 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21716 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21717 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21720 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21721 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21724 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21725 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21728 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21729 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21732 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21733 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21736 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21737 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21740 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21741 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21744 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21745 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21748 static PyMethodDef __pyx_methods_memoryview[] = {
21749 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21750 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21751 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21752 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21753 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21754 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21758 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21759 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21760 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21761 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21762 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21763 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21764 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21765 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21766 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21767 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21771 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21772 __pyx_memoryview___len__,
21775 __pyx_sq_item_memoryview,
21784 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21785 __pyx_memoryview___len__,
21786 __pyx_memoryview___getitem__,
21787 __pyx_mp_ass_subscript_memoryview,
21790 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21791 #if PY_MAJOR_VERSION < 3
21794 #if PY_MAJOR_VERSION < 3
21797 #if PY_MAJOR_VERSION < 3
21800 #if PY_MAJOR_VERSION < 3
21803 __pyx_memoryview_getbuffer,
21807 static PyTypeObject __pyx_type___pyx_memoryview = {
21808 PyVarObject_HEAD_INIT(0, 0)
21809 "imate._c_linear_operator.py_c_matrix.memoryview",
21810 sizeof(
struct __pyx_memoryview_obj),
21812 __pyx_tp_dealloc_memoryview,
21813 #
if PY_VERSION_HEX < 0x030800b4
21816 #
if PY_VERSION_HEX >= 0x030800b4
21821 #
if PY_MAJOR_VERSION < 3
21824 #
if PY_MAJOR_VERSION >= 3
21827 __pyx_memoryview___repr__,
21829 &__pyx_tp_as_sequence_memoryview,
21830 &__pyx_tp_as_mapping_memoryview,
21833 __pyx_memoryview___str__,
21836 &__pyx_tp_as_buffer_memoryview,
21837 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21839 __pyx_tp_traverse_memoryview,
21840 __pyx_tp_clear_memoryview,
21845 __pyx_methods_memoryview,
21847 __pyx_getsets_memoryview,
21855 __pyx_tp_new_memoryview,
21865 #
if PY_VERSION_HEX >= 0x030400a1
21868 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21871 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21874 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21878 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21880 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21881 struct __pyx_memoryviewslice_obj *p;
21882 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21883 if (unlikely(!o))
return 0;
21884 p = ((
struct __pyx_memoryviewslice_obj *)o);
21885 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21886 p->from_object = Py_None; Py_INCREF(Py_None);
21887 p->from_slice.memview = NULL;
21891 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21892 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21893 #if CYTHON_USE_TP_FINALIZE
21894 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21895 if (PyObject_CallFinalizerFromDealloc(o))
return;
21898 PyObject_GC_UnTrack(o);
21900 PyObject *etype, *eval, *etb;
21901 PyErr_Fetch(&etype, &eval, &etb);
21902 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21903 __pyx_memoryviewslice___dealloc__(o);
21904 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21905 PyErr_Restore(etype, eval, etb);
21907 Py_CLEAR(p->from_object);
21908 PyObject_GC_Track(o);
21909 __pyx_tp_dealloc_memoryview(o);
21912 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
21914 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21915 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
21916 if (p->from_object) {
21917 e = (*v)(p->from_object, a);
if (e)
return e;
21922 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21924 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21925 __pyx_tp_clear_memoryview(o);
21926 tmp = ((PyObject*)p->from_object);
21927 p->from_object = Py_None; Py_INCREF(Py_None);
21929 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21933 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21934 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21937 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21938 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21939 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21943 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21944 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21948 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21949 PyVarObject_HEAD_INIT(0, 0)
21950 "imate._c_linear_operator.py_c_matrix._memoryviewslice",
21951 sizeof(
struct __pyx_memoryviewslice_obj),
21953 __pyx_tp_dealloc__memoryviewslice,
21954 #
if PY_VERSION_HEX < 0x030800b4
21957 #
if PY_VERSION_HEX >= 0x030800b4
21962 #
if PY_MAJOR_VERSION < 3
21965 #
if PY_MAJOR_VERSION >= 3
21968 #
if CYTHON_COMPILING_IN_PYPY
21969 __pyx_memoryview___repr__,
21978 #
if CYTHON_COMPILING_IN_PYPY
21979 __pyx_memoryview___str__,
21986 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21987 "Internal class for passing memoryview slices to Python",
21988 __pyx_tp_traverse__memoryviewslice,
21989 __pyx_tp_clear__memoryviewslice,
21994 __pyx_methods__memoryviewslice,
21996 __pyx_getsets__memoryviewslice,
22004 __pyx_tp_new__memoryviewslice,
22014 #
if PY_VERSION_HEX >= 0x030400a1
22017 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22020 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22023 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
22028 static PyMethodDef __pyx_methods[] = {
22032 #if PY_MAJOR_VERSION >= 3
22033 #if CYTHON_PEP489_MULTI_PHASE_INIT
22034 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22035 static int __pyx_pymod_exec_py_c_matrix(PyObject* module);
22036 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22037 {Py_mod_create, (
void*)__pyx_pymod_create},
22038 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_matrix},
22043 static struct PyModuleDef __pyx_moduledef = {
22044 PyModuleDef_HEAD_INIT,
22047 #if CYTHON_PEP489_MULTI_PHASE_INIT
22053 #if CYTHON_PEP489_MULTI_PHASE_INIT
22054 __pyx_moduledef_slots,
22063 #ifndef CYTHON_SMALL_CODE
22064 #if defined(__clang__)
22065 #define CYTHON_SMALL_CODE
22066 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22067 #define CYTHON_SMALL_CODE __attribute__((cold))
22069 #define CYTHON_SMALL_CODE
22073 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22074 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
22075 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22076 {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None,
sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
22077 {&__pyx_n_s_A_data_double, __pyx_k_A_data_double,
sizeof(__pyx_k_A_data_double), 0, 0, 1, 1},
22078 {&__pyx_n_s_A_data_double_mv, __pyx_k_A_data_double_mv,
sizeof(__pyx_k_A_data_double_mv), 0, 0, 1, 1},
22079 {&__pyx_n_s_A_data_double_mv_c, __pyx_k_A_data_double_mv_c,
sizeof(__pyx_k_A_data_double_mv_c), 0, 0, 1, 1},
22080 {&__pyx_n_s_A_data_double_mv_f, __pyx_k_A_data_double_mv_f,
sizeof(__pyx_k_A_data_double_mv_f), 0, 0, 1, 1},
22081 {&__pyx_n_s_A_data_float, __pyx_k_A_data_float,
sizeof(__pyx_k_A_data_float), 0, 0, 1, 1},
22082 {&__pyx_n_s_A_data_float_mv, __pyx_k_A_data_float_mv,
sizeof(__pyx_k_A_data_float_mv), 0, 0, 1, 1},
22083 {&__pyx_n_s_A_data_float_mv_c, __pyx_k_A_data_float_mv_c,
sizeof(__pyx_k_A_data_float_mv_c), 0, 0, 1, 1},
22084 {&__pyx_n_s_A_data_float_mv_f, __pyx_k_A_data_float_mv_f,
sizeof(__pyx_k_A_data_float_mv_f), 0, 0, 1, 1},
22085 {&__pyx_n_s_A_data_long_double, __pyx_k_A_data_long_double,
sizeof(__pyx_k_A_data_long_double), 0, 0, 1, 1},
22086 {&__pyx_n_s_A_data_long_double_mv, __pyx_k_A_data_long_double_mv,
sizeof(__pyx_k_A_data_long_double_mv), 0, 0, 1, 1},
22087 {&__pyx_n_s_A_data_long_double_mv_c, __pyx_k_A_data_long_double_mv_c,
sizeof(__pyx_k_A_data_long_double_mv_c), 0, 0, 1, 1},
22088 {&__pyx_n_s_A_data_long_double_mv_f, __pyx_k_A_data_long_double_mv_f,
sizeof(__pyx_k_A_data_long_double_mv_f), 0, 0, 1, 1},
22089 {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer,
sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
22090 {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv,
sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
22091 {&__pyx_n_s_A_indices, __pyx_k_A_indices,
sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
22092 {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv,
sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
22093 {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major,
sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
22094 {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns,
sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
22095 {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows,
sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
22096 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22097 {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS,
sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
22098 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22099 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22100 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22101 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22102 {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa,
sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
22103 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22104 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22105 {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS,
sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
22106 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
22107 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22108 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22109 {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen,
sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
22110 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22111 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22112 {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
22113 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22114 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22115 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22116 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22117 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22118 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22119 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22120 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22121 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22122 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22123 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22124 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
22125 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22126 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22127 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22128 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22129 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22130 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22131 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22132 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
22133 {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix,
sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
22134 {&__pyx_n_s_data, __pyx_k_data,
sizeof(__pyx_k_data), 0, 0, 1, 1},
22135 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22136 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
22137 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22138 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22139 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22140 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22141 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22142 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
22143 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
22144 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
22145 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22146 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22147 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22148 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22149 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22150 {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices,
sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
22151 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22152 {&__pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_k_imate__c_linear_operator_py_c_ma,
sizeof(__pyx_k_imate__c_linear_operator_py_c_ma), 0, 0, 1, 0},
22153 {&__pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_k_imate__c_linear_operator_py_c_ma_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_ma_2), 0, 0, 1, 1},
22154 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22155 {&__pyx_n_s_indices, __pyx_k_indices,
sizeof(__pyx_k_indices), 0, 0, 1, 1},
22156 {&__pyx_n_s_indptr, __pyx_k_indptr,
sizeof(__pyx_k_indptr), 0, 0, 1, 1},
22157 {&__pyx_n_s_issparse, __pyx_k_issparse,
sizeof(__pyx_k_issparse), 0, 0, 1, 1},
22158 {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc,
sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
22159 {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr,
sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
22160 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22161 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22162 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22163 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22164 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22165 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22166 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22167 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22168 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22169 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22170 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22171 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22172 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22173 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22174 {&__pyx_n_s_pycMatrix, __pyx_k_pycMatrix,
sizeof(__pyx_k_pycMatrix), 0, 0, 1, 1},
22175 {&__pyx_n_s_pycMatrix___reduce_cython, __pyx_k_pycMatrix___reduce_cython,
sizeof(__pyx_k_pycMatrix___reduce_cython), 0, 0, 1, 1},
22176 {&__pyx_n_s_pycMatrix___setstate_cython, __pyx_k_pycMatrix___setstate_cython,
sizeof(__pyx_k_pycMatrix___setstate_cython), 0, 0, 1, 1},
22177 {&__pyx_n_s_pycMatrix_set_csc_matrix_double, __pyx_k_pycMatrix_set_csc_matrix_double,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_double), 0, 0, 1, 1},
22178 {&__pyx_n_s_pycMatrix_set_csc_matrix_float, __pyx_k_pycMatrix_set_csc_matrix_float,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_float), 0, 0, 1, 1},
22179 {&__pyx_n_s_pycMatrix_set_csc_matrix_long_do, __pyx_k_pycMatrix_set_csc_matrix_long_do,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_long_do), 0, 0, 1, 1},
22180 {&__pyx_n_s_pycMatrix_set_csr_matrix_double, __pyx_k_pycMatrix_set_csr_matrix_double,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_double), 0, 0, 1, 1},
22181 {&__pyx_n_s_pycMatrix_set_csr_matrix_float, __pyx_k_pycMatrix_set_csr_matrix_float,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_float), 0, 0, 1, 1},
22182 {&__pyx_n_s_pycMatrix_set_csr_matrix_long_do, __pyx_k_pycMatrix_set_csr_matrix_long_do,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_long_do), 0, 0, 1, 1},
22183 {&__pyx_n_s_pycMatrix_set_dense_matrix_doubl, __pyx_k_pycMatrix_set_dense_matrix_doubl,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_doubl), 0, 0, 1, 1},
22184 {&__pyx_n_s_pycMatrix_set_dense_matrix_float, __pyx_k_pycMatrix_set_dense_matrix_float,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_float), 0, 0, 1, 1},
22185 {&__pyx_n_s_pycMatrix_set_dense_matrix_long, __pyx_k_pycMatrix_set_dense_matrix_long,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_long), 0, 0, 1, 1},
22186 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22187 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22188 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22189 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22190 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22191 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22192 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22193 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22194 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22195 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22196 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22197 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22198 {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse,
sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
22199 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22200 {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double,
sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
22201 {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float,
sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
22202 {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double,
sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
22203 {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double,
sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
22204 {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float,
sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
22205 {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double,
sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
22206 {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double,
sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
22207 {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float,
sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
22208 {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double,
sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
22209 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22210 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22211 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22212 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22213 {&__pyx_n_s_sort_indices, __pyx_k_sort_indices,
sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
22214 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22215 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22216 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22217 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22218 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22219 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22220 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22221 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22222 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22223 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22224 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22225 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22226 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22227 {0, 0, 0, 0, 0, 0, 0}
22229 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22230 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
22231 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 142, __pyx_L1_error)
22232 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
22233 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
22234 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
22235 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
22236 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
22237 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
22243 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22244 __Pyx_RefNannyDeclarations
22245 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22254 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 126, __pyx_L1_error)
22255 __Pyx_GOTREF(__pyx_tuple_);
22256 __Pyx_GIVEREF(__pyx_tuple_);
22265 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error)
22266 __Pyx_GOTREF(__pyx_tuple__2);
22267 __Pyx_GIVEREF(__pyx_tuple__2);
22276 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error)
22277 __Pyx_GOTREF(__pyx_tuple__3);
22278 __Pyx_GIVEREF(__pyx_tuple__3);
22287 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 235, __pyx_L1_error)
22288 __Pyx_GOTREF(__pyx_tuple__5);
22289 __Pyx_GIVEREF(__pyx_tuple__5);
22297 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
22298 __Pyx_GOTREF(__pyx_tuple__15);
22299 __Pyx_GIVEREF(__pyx_tuple__15);
22306 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
22307 __Pyx_GOTREF(__pyx_tuple__17);
22308 __Pyx_GIVEREF(__pyx_tuple__17);
22317 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 134, __pyx_L1_error)
22318 __Pyx_GOTREF(__pyx_tuple__18);
22319 __Pyx_GIVEREF(__pyx_tuple__18);
22328 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 137, __pyx_L1_error)
22329 __Pyx_GOTREF(__pyx_tuple__19);
22330 __Pyx_GIVEREF(__pyx_tuple__19);
22339 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 149, __pyx_L1_error)
22340 __Pyx_GOTREF(__pyx_tuple__20);
22341 __Pyx_GIVEREF(__pyx_tuple__20);
22350 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 177, __pyx_L1_error)
22351 __Pyx_GOTREF(__pyx_tuple__21);
22352 __Pyx_GIVEREF(__pyx_tuple__21);
22361 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 193, __pyx_L1_error)
22362 __Pyx_GOTREF(__pyx_tuple__22);
22363 __Pyx_GIVEREF(__pyx_tuple__22);
22371 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22372 __Pyx_GOTREF(__pyx_tuple__23);
22373 __Pyx_GIVEREF(__pyx_tuple__23);
22380 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22381 __Pyx_GOTREF(__pyx_tuple__24);
22382 __Pyx_GIVEREF(__pyx_tuple__24);
22391 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 420, __pyx_L1_error)
22392 __Pyx_GOTREF(__pyx_tuple__25);
22393 __Pyx_GIVEREF(__pyx_tuple__25);
22402 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 497, __pyx_L1_error)
22403 __Pyx_GOTREF(__pyx_tuple__26);
22404 __Pyx_GIVEREF(__pyx_tuple__26);
22413 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 522, __pyx_L1_error)
22414 __Pyx_GOTREF(__pyx_tuple__27);
22415 __Pyx_GIVEREF(__pyx_tuple__27);
22424 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 572, __pyx_L1_error)
22425 __Pyx_GOTREF(__pyx_tuple__28);
22426 __Pyx_GIVEREF(__pyx_tuple__28);
22435 __pyx_tuple__29 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 579, __pyx_L1_error)
22436 __Pyx_GOTREF(__pyx_tuple__29);
22437 __Pyx_INCREF(__pyx_int_neg_1);
22438 __Pyx_GIVEREF(__pyx_int_neg_1);
22439 PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
22440 __Pyx_GIVEREF(__pyx_tuple__29);
22448 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
22449 __Pyx_GOTREF(__pyx_tuple__30);
22450 __Pyx_GIVEREF(__pyx_tuple__30);
22457 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
22458 __Pyx_GOTREF(__pyx_tuple__31);
22459 __Pyx_GIVEREF(__pyx_tuple__31);
22468 __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 684, __pyx_L1_error)
22469 __Pyx_GOTREF(__pyx_slice__32);
22470 __Pyx_GIVEREF(__pyx_slice__32);
22479 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 705, __pyx_L1_error)
22480 __Pyx_GOTREF(__pyx_tuple__33);
22481 __Pyx_GIVEREF(__pyx_tuple__33);
22489 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22490 __Pyx_GOTREF(__pyx_tuple__34);
22491 __Pyx_GIVEREF(__pyx_tuple__34);
22498 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22499 __Pyx_GOTREF(__pyx_tuple__35);
22500 __Pyx_GIVEREF(__pyx_tuple__35);
22501 __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error)
22502 __Pyx_GOTREF(__pyx_tuple__37);
22503 __Pyx_GIVEREF(__pyx_tuple__37);
22512 __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_float_mv_c, __pyx_n_s_A_data_float_mv_f, __pyx_n_s_A_data_float);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 216, __pyx_L1_error)
22513 __Pyx_GOTREF(__pyx_tuple__38);
22514 __Pyx_GIVEREF(__pyx_tuple__38);
22515 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_float, 216, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 216, __pyx_L1_error)
22524 __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_double_mv_c, __pyx_n_s_A_data_double_mv_f, __pyx_n_s_A_data_double);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 272, __pyx_L1_error)
22525 __Pyx_GOTREF(__pyx_tuple__39);
22526 __Pyx_GIVEREF(__pyx_tuple__39);
22527 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_double, 272, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 272, __pyx_L1_error)
22536 __pyx_tuple__40 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_long_double_mv_c, __pyx_n_s_A_data_long_double_mv_f, __pyx_n_s_A_data_long_double);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 328, __pyx_L1_error)
22537 __Pyx_GOTREF(__pyx_tuple__40);
22538 __Pyx_GIVEREF(__pyx_tuple__40);
22539 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_long_double, 328, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 328, __pyx_L1_error)
22548 __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 384, __pyx_L1_error)
22549 __Pyx_GOTREF(__pyx_tuple__41);
22550 __Pyx_GIVEREF(__pyx_tuple__41);
22551 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_float, 384, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 384, __pyx_L1_error)
22560 __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 431, __pyx_L1_error)
22561 __Pyx_GOTREF(__pyx_tuple__42);
22562 __Pyx_GIVEREF(__pyx_tuple__42);
22563 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_double, 431, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 431, __pyx_L1_error)
22572 __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 478, __pyx_L1_error)
22573 __Pyx_GOTREF(__pyx_tuple__43);
22574 __Pyx_GIVEREF(__pyx_tuple__43);
22575 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_long_double, 478, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 478, __pyx_L1_error)
22584 __pyx_tuple__44 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 525, __pyx_L1_error)
22585 __Pyx_GOTREF(__pyx_tuple__44);
22586 __Pyx_GIVEREF(__pyx_tuple__44);
22587 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_float, 525, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 525, __pyx_L1_error)
22596 __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 572, __pyx_L1_error)
22597 __Pyx_GOTREF(__pyx_tuple__45);
22598 __Pyx_GIVEREF(__pyx_tuple__45);
22599 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_double, 572, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 572, __pyx_L1_error)
22608 __pyx_tuple__46 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 619, __pyx_L1_error)
22609 __Pyx_GOTREF(__pyx_tuple__46);
22610 __Pyx_GIVEREF(__pyx_tuple__46);
22611 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_long_double, 619, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 619, __pyx_L1_error)
22618 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 1, __pyx_L1_error)
22619 __Pyx_GOTREF(__pyx_tuple__47);
22620 __Pyx_GIVEREF(__pyx_tuple__47);
22621 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
22629 __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 3, __pyx_L1_error)
22630 __Pyx_GOTREF(__pyx_tuple__48);
22631 __Pyx_GIVEREF(__pyx_tuple__48);
22632 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
22641 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
22642 __Pyx_GOTREF(__pyx_tuple__49);
22643 __Pyx_GIVEREF(__pyx_tuple__49);
22652 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
22653 __Pyx_GOTREF(__pyx_tuple__50);
22654 __Pyx_GIVEREF(__pyx_tuple__50);
22663 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 289, __pyx_L1_error)
22664 __Pyx_GOTREF(__pyx_tuple__51);
22665 __Pyx_GIVEREF(__pyx_tuple__51);
22674 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
22675 __Pyx_GOTREF(__pyx_tuple__52);
22676 __Pyx_GIVEREF(__pyx_tuple__52);
22685 __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 293, __pyx_L1_error)
22686 __Pyx_GOTREF(__pyx_tuple__53);
22687 __Pyx_GIVEREF(__pyx_tuple__53);
22694 __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 1, __pyx_L1_error)
22695 __Pyx_GOTREF(__pyx_tuple__54);
22696 __Pyx_GIVEREF(__pyx_tuple__54);
22697 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22698 __Pyx_RefNannyFinishContext();
22701 __Pyx_RefNannyFinishContext();
22705 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
22707 __Pyx_init_assertions_enabled();
22709 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
22711 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22712 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22713 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22714 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22715 __pyx_int_112105877 = PyInt_FromLong(112105877L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
22716 __pyx_int_136983863 = PyInt_FromLong(136983863L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
22717 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22718 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22724 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
22725 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
22726 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
22727 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
22728 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
22729 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22730 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22732 static int __Pyx_modinit_global_init_code(
void) {
22733 __Pyx_RefNannyDeclarations
22734 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22736 generic = Py_None; Py_INCREF(Py_None);
22737 strided = Py_None; Py_INCREF(Py_None);
22738 indirect = Py_None; Py_INCREF(Py_None);
22739 contiguous = Py_None; Py_INCREF(Py_None);
22740 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22741 __Pyx_RefNannyFinishContext();
22745 static int __Pyx_modinit_variable_export_code(
void) {
22746 __Pyx_RefNannyDeclarations
22747 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22749 __Pyx_RefNannyFinishContext();
22753 static int __Pyx_modinit_function_export_code(
void) {
22754 __Pyx_RefNannyDeclarations
22755 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22757 __Pyx_RefNannyFinishContext();
22761 static int __Pyx_modinit_type_init_code(
void) {
22762 __Pyx_RefNannyDeclarations
22763 PyObject *__pyx_t_1 = NULL;
22764 int __pyx_lineno = 0;
22765 const char *__pyx_filename = NULL;
22766 int __pyx_clineno = 0;
22767 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22769 __pyx_t_1 = PyImport_ImportModule(
"imate._c_linear_operator.py_c_linear_operator");
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22770 __Pyx_GOTREF(__pyx_t_1);
22771 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType_0_29_36(__pyx_t_1,
"imate._c_linear_operator.py_c_linear_operator",
"pycLinearOperator",
sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __PYX_GET_STRUCT_ALIGNMENT_0_29_36(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),__Pyx_ImportType_CheckSize_Warn_0_29_36);
if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
22772 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict);
if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
22773 __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22774 __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22775 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22776 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22777 #if PY_VERSION_HEX < 0x030800B1
22778 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_print = 0;
22780 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22781 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22783 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22784 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycMatrix, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22785 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22786 __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22787 __pyx_vtabptr_array = &__pyx_vtable_array;
22788 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
22789 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22790 #if PY_VERSION_HEX < 0x030800B1
22791 __pyx_type___pyx_array.tp_print = 0;
22793 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22794 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
22795 __pyx_array_type = &__pyx_type___pyx_array;
22796 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22797 #if PY_VERSION_HEX < 0x030800B1
22798 __pyx_type___pyx_MemviewEnum.tp_print = 0;
22800 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22801 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22803 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
22804 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22805 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22806 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22807 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22808 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22809 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22810 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22811 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
22812 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22813 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22814 #if PY_VERSION_HEX < 0x030800B1
22815 __pyx_type___pyx_memoryview.tp_print = 0;
22817 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22818 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22820 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22821 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
22822 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22823 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22824 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22825 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22826 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22827 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22828 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22829 #if PY_VERSION_HEX < 0x030800B1
22830 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22832 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22833 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22835 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22836 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22837 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22838 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22839 __Pyx_RefNannyFinishContext();
22842 __Pyx_XDECREF(__pyx_t_1);
22843 __Pyx_RefNannyFinishContext();
22847 static int __Pyx_modinit_type_import_code(
void) {
22848 __Pyx_RefNannyDeclarations
22849 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22851 __Pyx_RefNannyFinishContext();
22855 static int __Pyx_modinit_variable_import_code(
void) {
22856 __Pyx_RefNannyDeclarations
22857 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22859 __Pyx_RefNannyFinishContext();
22863 static int __Pyx_modinit_function_import_code(
void) {
22864 __Pyx_RefNannyDeclarations
22865 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22867 __Pyx_RefNannyFinishContext();
22872 #ifndef CYTHON_NO_PYINIT_EXPORT
22873 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22874 #elif PY_MAJOR_VERSION < 3
22876 #define __Pyx_PyMODINIT_FUNC extern "C" void
22878 #define __Pyx_PyMODINIT_FUNC void
22882 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22884 #define __Pyx_PyMODINIT_FUNC PyObject *
22889 #if PY_MAJOR_VERSION < 3
22890 __Pyx_PyMODINIT_FUNC initpy_c_matrix(
void) CYTHON_SMALL_CODE;
22891 __Pyx_PyMODINIT_FUNC initpy_c_matrix(
void)
22893 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(
void) CYTHON_SMALL_CODE;
22894 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(
void)
22895 #if CYTHON_PEP489_MULTI_PHASE_INIT
22897 return PyModuleDef_Init(&__pyx_moduledef);
22899 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22900 #if PY_VERSION_HEX >= 0x030700A1
22901 static PY_INT64_T main_interpreter_id = -1;
22902 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22903 if (main_interpreter_id == -1) {
22904 main_interpreter_id = current_id;
22905 return (unlikely(current_id == -1)) ? -1 : 0;
22906 }
else if (unlikely(main_interpreter_id != current_id))
22908 static PyInterpreterState *main_interpreter = NULL;
22909 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22910 if (!main_interpreter) {
22911 main_interpreter = current_interpreter;
22912 }
else if (unlikely(main_interpreter != current_interpreter))
22917 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22922 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
22923 PyObject *value = PyObject_GetAttrString(spec, from_name);
22925 if (likely(value)) {
22926 if (allow_none || value != Py_None) {
22927 result = PyDict_SetItemString(moddict, to_name, value);
22930 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22937 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22938 PyObject *module = NULL, *moddict, *modname;
22939 if (__Pyx_check_single_interpreter())
22942 return __Pyx_NewRef(__pyx_m);
22943 modname = PyObject_GetAttrString(spec,
"name");
22944 if (unlikely(!modname))
goto bad;
22945 module = PyModule_NewObject(modname);
22946 Py_DECREF(modname);
22947 if (unlikely(!module))
goto bad;
22948 moddict = PyModule_GetDict(module);
22949 if (unlikely(!moddict))
goto bad;
22950 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22951 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22952 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22953 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22956 Py_XDECREF(module);
22961 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_matrix(PyObject *__pyx_pyinit_module)
22965 __Pyx_TraceDeclarations
22966 PyObject *__pyx_t_1 = NULL;
22967 PyObject *__pyx_t_2 = NULL;
22968 static PyThread_type_lock __pyx_t_3[8];
22969 int __pyx_lineno = 0;
22970 const char *__pyx_filename = NULL;
22971 int __pyx_clineno = 0;
22972 __Pyx_RefNannyDeclarations
22973 #if CYTHON_PEP489_MULTI_PHASE_INIT
22975 if (__pyx_m == __pyx_pyinit_module)
return 0;
22976 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_matrix' has already been imported. Re-initialisation is not supported.");
22979 #elif PY_MAJOR_VERSION >= 3
22980 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22982 #if CYTHON_REFNANNY
22983 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22984 if (!__Pyx_RefNanny) {
22986 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22987 if (!__Pyx_RefNanny)
22988 Py_FatalError(
"failed to import 'refnanny' module");
22991 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", 0);
22992 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22993 #ifdef __Pxy_PyFrame_Initialize_Offsets
22994 __Pxy_PyFrame_Initialize_Offsets();
22996 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22997 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22998 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22999 #ifdef __Pyx_CyFunction_USED
23000 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23002 #ifdef __Pyx_FusedFunction_USED
23003 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23005 #ifdef __Pyx_Coroutine_USED
23006 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23008 #ifdef __Pyx_Generator_USED
23009 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23011 #ifdef __Pyx_AsyncGen_USED
23012 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23014 #ifdef __Pyx_StopAsyncIteration_USED
23015 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23019 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23020 PyEval_InitThreads();
23023 #if CYTHON_PEP489_MULTI_PHASE_INIT
23024 __pyx_m = __pyx_pyinit_module;
23025 Py_INCREF(__pyx_m);
23027 #if PY_MAJOR_VERSION < 3
23028 __pyx_m = Py_InitModule4(
"py_c_matrix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23030 __pyx_m = PyModule_Create(&__pyx_moduledef);
23032 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23034 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23035 Py_INCREF(__pyx_d);
23036 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23037 Py_INCREF(__pyx_b);
23038 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23039 Py_INCREF(__pyx_cython_runtime);
23040 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23042 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23043 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23044 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23046 if (__pyx_module_is_main_imate___c_linear_operator__py_c_matrix) {
23047 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23049 #if PY_MAJOR_VERSION >= 3
23051 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23052 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_matrix")) {
23053 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_matrix", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23058 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23060 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23062 (void)__Pyx_modinit_global_init_code();
23063 (void)__Pyx_modinit_variable_export_code();
23064 (void)__Pyx_modinit_function_export_code();
23065 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23066 (void)__Pyx_modinit_type_import_code();
23067 (void)__Pyx_modinit_variable_import_code();
23068 (void)__Pyx_modinit_function_import_code();
23070 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23071 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23073 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
23082 __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
23083 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
23084 __Pyx_GOTREF(__pyx_t_1);
23085 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
23086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23095 __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
23096 __pyx_t_1 = PyList_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23097 __Pyx_GOTREF(__pyx_t_1);
23098 __Pyx_INCREF(__pyx_n_s_issparse);
23099 __Pyx_GIVEREF(__pyx_n_s_issparse);
23100 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
23101 __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
23102 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
23103 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
23104 __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
23105 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
23106 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
23107 __Pyx_INCREF(__pyx_n_s_csr_matrix);
23108 __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
23109 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
23110 __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
23111 __Pyx_GOTREF(__pyx_t_2);
23112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23113 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23114 __Pyx_GOTREF(__pyx_t_1);
23115 if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23116 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23117 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23118 __Pyx_GOTREF(__pyx_t_1);
23119 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23121 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23122 __Pyx_GOTREF(__pyx_t_1);
23123 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23125 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
23126 __Pyx_GOTREF(__pyx_t_1);
23127 if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
23128 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23129 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23138 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
23139 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
23140 __Pyx_GOTREF(__pyx_t_2);
23141 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
23142 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23143 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23152 __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
23153 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_doubl, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
23154 __Pyx_GOTREF(__pyx_t_2);
23155 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
23156 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23157 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23166 __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
23167 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_long, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__7));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
23168 __Pyx_GOTREF(__pyx_t_2);
23169 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
23170 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23171 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23180 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
23181 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
23182 __Pyx_GOTREF(__pyx_t_2);
23183 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
23184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23185 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23194 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
23195 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
23196 __Pyx_GOTREF(__pyx_t_2);
23197 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
23198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23199 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23208 __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error))
23209 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
23210 __Pyx_GOTREF(__pyx_t_2);
23211 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
23212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23213 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23222 __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
23223 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__11));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
23224 __Pyx_GOTREF(__pyx_t_2);
23225 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
23226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23227 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23236 __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
23237 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
23238 __Pyx_GOTREF(__pyx_t_2);
23239 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
23240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23241 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23250 __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error))
23251 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
23252 __Pyx_GOTREF(__pyx_t_2);
23253 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
23254 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23255 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
23262 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23263 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___reduce_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23264 __Pyx_GOTREF(__pyx_t_2);
23265 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23274 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
23275 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___setstate_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
23276 __Pyx_GOTREF(__pyx_t_2);
23277 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23278 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23285 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
23286 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23287 __Pyx_GOTREF(__pyx_t_2);
23288 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23289 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23298 __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
23299 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
23300 __Pyx_GOTREF(__pyx_t_2);
23301 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
23302 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23303 PyType_Modified(__pyx_array_type);
23312 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
23322 __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
23332 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
23333 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
23334 __Pyx_GOTREF(__pyx_t_2);
23335 __Pyx_XGOTREF(
generic);
23336 __Pyx_DECREF_SET(
generic, __pyx_t_2);
23337 __Pyx_GIVEREF(__pyx_t_2);
23347 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
23348 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
23349 __Pyx_GOTREF(__pyx_t_2);
23350 __Pyx_XGOTREF(strided);
23351 __Pyx_DECREF_SET(strided, __pyx_t_2);
23352 __Pyx_GIVEREF(__pyx_t_2);
23362 __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
23363 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
23364 __Pyx_GOTREF(__pyx_t_2);
23365 __Pyx_XGOTREF(indirect);
23366 __Pyx_DECREF_SET(indirect, __pyx_t_2);
23367 __Pyx_GIVEREF(__pyx_t_2);
23377 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
23378 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
23379 __Pyx_GOTREF(__pyx_t_2);
23380 __Pyx_XGOTREF(contiguous);
23381 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23382 __Pyx_GIVEREF(__pyx_t_2);
23392 __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
23393 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
23394 __Pyx_GOTREF(__pyx_t_2);
23395 __Pyx_XGOTREF(indirect_contiguous);
23396 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23397 __Pyx_GIVEREF(__pyx_t_2);
23407 __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
23417 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
23418 __pyx_memoryview_thread_locks_used = 0;
23427 __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
23428 __pyx_t_3[0] = PyThread_allocate_lock();
23429 __pyx_t_3[1] = PyThread_allocate_lock();
23430 __pyx_t_3[2] = PyThread_allocate_lock();
23431 __pyx_t_3[3] = PyThread_allocate_lock();
23432 __pyx_t_3[4] = PyThread_allocate_lock();
23433 __pyx_t_3[5] = PyThread_allocate_lock();
23434 __pyx_t_3[6] = PyThread_allocate_lock();
23435 __pyx_t_3[7] = PyThread_allocate_lock();
23436 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23445 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
23455 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
23465 __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
23475 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
23485 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
23495 __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
23505 __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
23515 __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
23516 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
23517 __Pyx_GOTREF(__pyx_t_2);
23518 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
23519 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23520 PyType_Modified(__pyx_memoryview_type);
23529 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
23539 __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
23549 __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
23559 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
23569 __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
23579 __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
23589 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
23599 __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
23609 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
23619 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
23629 __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
23630 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
23631 __Pyx_GOTREF(__pyx_t_2);
23632 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
23633 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23634 PyType_Modified(__pyx_memoryviewslice_type);
23643 __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
23653 __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
23663 __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
23673 __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
23683 __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
23693 __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
23703 __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
23713 __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
23723 __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
23733 __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
23743 __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
23753 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
23763 __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
23773 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
23783 __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
23793 __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
23803 __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
23813 __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
23823 __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
23833 __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
23843 __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
23851 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23852 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23853 __Pyx_GOTREF(__pyx_t_2);
23854 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23855 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23864 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23866 __Pyx_TraceReturn(Py_None, 0);
23872 __Pyx_XDECREF(__pyx_t_1);
23873 __Pyx_XDECREF(__pyx_t_2);
23876 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
23879 }
else if (!PyErr_Occurred()) {
23880 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_matrix");
23883 __Pyx_RefNannyFinishContext();
23884 #if CYTHON_PEP489_MULTI_PHASE_INIT
23885 return (__pyx_m != NULL) ? 0 : -1;
23886 #elif PY_MAJOR_VERSION >= 3
23895 #if CYTHON_REFNANNY
23896 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23897 PyObject *m = NULL, *p = NULL;
23899 m = PyImport_ImportModule(modname);
23901 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23903 r = PyLong_AsVoidPtr(p);
23907 return (__Pyx_RefNannyAPIStruct *)r;
23912 #if CYTHON_USE_TYPE_SLOTS
23913 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23914 PyTypeObject* tp = Py_TYPE(obj);
23915 if (likely(tp->tp_getattro))
23916 return tp->tp_getattro(obj, attr_name);
23917 #if PY_MAJOR_VERSION < 3
23918 if (likely(tp->tp_getattr))
23919 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23921 return PyObject_GetAttr(obj, attr_name);
23926 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23927 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23928 if (unlikely(!result)) {
23929 PyErr_Format(PyExc_NameError,
23930 #
if PY_MAJOR_VERSION >= 3
23931 "name '%U' is not defined", name);
23933 "name '%.200s' is not defined", PyString_AS_STRING(name));
23940 static void __Pyx_RaiseDoubleKeywordsError(
23941 const char* func_name,
23944 PyErr_Format(PyExc_TypeError,
23945 #
if PY_MAJOR_VERSION >= 3
23946 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23948 "%s() got multiple values for keyword argument '%s'", func_name,
23949 PyString_AsString(kw_name));
23954 static int __Pyx_ParseOptionalKeywords(
23956 PyObject **argnames[],
23958 PyObject *values[],
23959 Py_ssize_t num_pos_args,
23960 const char* function_name)
23962 PyObject *key = 0, *value = 0;
23963 Py_ssize_t pos = 0;
23965 PyObject*** first_kw_arg = argnames + num_pos_args;
23966 while (PyDict_Next(kwds, &pos, &key, &value)) {
23967 name = first_kw_arg;
23968 while (*name && (**name != key)) name++;
23970 values[name-argnames] = value;
23973 name = first_kw_arg;
23974 #if PY_MAJOR_VERSION < 3
23975 if (likely(PyString_Check(key))) {
23977 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23978 && _PyString_Eq(**name, key)) {
23979 values[name-argnames] = value;
23984 if (*name)
continue;
23986 PyObject*** argname = argnames;
23987 while (argname != first_kw_arg) {
23988 if ((**argname == key) || (
23989 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23990 && _PyString_Eq(**argname, key))) {
23991 goto arg_passed_twice;
23998 if (likely(PyUnicode_Check(key))) {
24000 int cmp = (**name == key) ? 0 :
24001 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24002 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24004 PyUnicode_Compare(**name, key);
24005 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24007 values[name-argnames] = value;
24012 if (*name)
continue;
24014 PyObject*** argname = argnames;
24015 while (argname != first_kw_arg) {
24016 int cmp = (**argname == key) ? 0 :
24017 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24018 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24020 PyUnicode_Compare(**argname, key);
24021 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24022 if (cmp == 0)
goto arg_passed_twice;
24027 goto invalid_keyword_type;
24029 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24031 goto invalid_keyword;
24036 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24038 invalid_keyword_type:
24039 PyErr_Format(PyExc_TypeError,
24040 "%.200s() keywords must be strings", function_name);
24043 PyErr_Format(PyExc_TypeError,
24044 #
if PY_MAJOR_VERSION < 3
24045 "%.200s() got an unexpected keyword argument '%.200s'",
24046 function_name, PyString_AsString(key));
24048 "%s() got an unexpected keyword argument '%U'",
24049 function_name, key);
24056 static void __Pyx_RaiseArgtupleInvalid(
24057 const char* func_name,
24059 Py_ssize_t num_min,
24060 Py_ssize_t num_max,
24061 Py_ssize_t num_found)
24063 Py_ssize_t num_expected;
24064 const char *more_or_less;
24065 if (num_found < num_min) {
24066 num_expected = num_min;
24067 more_or_less =
"at least";
24069 num_expected = num_max;
24070 more_or_less =
"at most";
24073 more_or_less =
"exactly";
24075 PyErr_Format(PyExc_TypeError,
24076 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24077 func_name, more_or_less, num_expected,
24078 (num_expected == 1) ?
"" :
"s", num_found);
24082 #if CYTHON_FAST_THREAD_STATE
24083 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24084 PyObject *tmp_type, *tmp_value, *tmp_tb;
24085 tmp_type = tstate->curexc_type;
24086 tmp_value = tstate->curexc_value;
24087 tmp_tb = tstate->curexc_traceback;
24088 tstate->curexc_type = type;
24089 tstate->curexc_value = value;
24090 tstate->curexc_traceback = tb;
24091 Py_XDECREF(tmp_type);
24092 Py_XDECREF(tmp_value);
24093 Py_XDECREF(tmp_tb);
24095 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24096 *type = tstate->curexc_type;
24097 *value = tstate->curexc_value;
24098 *tb = tstate->curexc_traceback;
24099 tstate->curexc_type = 0;
24100 tstate->curexc_value = 0;
24101 tstate->curexc_traceback = 0;
24107 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24108 PyFrameObject** frame,
24109 PyThreadState* tstate,
24110 const char *funcname,
24111 const char *srcfile,
24113 PyObject *type, *value, *traceback;
24115 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24116 if (*code == NULL) {
24117 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24118 if (*code == NULL)
return 0;
24120 *frame = PyFrame_New(
24126 if (*frame == NULL)
return 0;
24127 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24128 Py_INCREF(Py_None);
24129 (*frame)->f_trace = Py_None;
24131 #if PY_VERSION_HEX < 0x030400B1
24133 (*frame)->f_tstate = tstate;
24136 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24138 __Pyx_EnterTracing(tstate);
24139 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24141 if (tstate->c_tracefunc)
24142 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24143 if (retval && tstate->c_profilefunc)
24145 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24146 __Pyx_LeaveTracing(tstate);
24148 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24149 return __Pyx_IsTracing(tstate, 0, 0) && retval;
24153 Py_XDECREF(traceback);
24157 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
24158 PyCodeObject *py_code = 0;
24159 #if PY_MAJOR_VERSION >= 3
24160 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24161 if (likely(py_code)) {
24162 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24165 PyObject *py_srcfile = 0;
24166 PyObject *py_funcname = 0;
24167 py_funcname = PyString_FromString(funcname);
24168 if (unlikely(!py_funcname))
goto bad;
24169 py_srcfile = PyString_FromString(srcfile);
24170 if (unlikely(!py_srcfile))
goto bad;
24171 py_code = PyCode_New(
24175 CO_OPTIMIZED | CO_NEWLOCALS,
24188 Py_XDECREF(py_srcfile);
24189 Py_XDECREF(py_funcname);
24196 #if CYTHON_COMPILING_IN_CPYTHON
24197 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24199 ternaryfunc call = Py_TYPE(func)->tp_call;
24200 if (unlikely(!call))
24201 return PyObject_Call(func, arg, kw);
24202 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24204 result = (*call)(func, arg, kw);
24205 Py_LeaveRecursiveCall();
24206 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24209 "NULL result without error in PyObject_Call");
24216 #if PY_MAJOR_VERSION < 3
24217 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24218 CYTHON_UNUSED PyObject *cause) {
24219 __Pyx_PyThreadState_declare
24221 if (!value || value == Py_None)
24225 if (!tb || tb == Py_None)
24229 if (!PyTraceBack_Check(tb)) {
24230 PyErr_SetString(PyExc_TypeError,
24231 "raise: arg 3 must be a traceback or None");
24235 if (PyType_Check(type)) {
24236 #if CYTHON_COMPILING_IN_PYPY
24238 Py_INCREF(Py_None);
24242 PyErr_NormalizeException(&type, &value, &tb);
24245 PyErr_SetString(PyExc_TypeError,
24246 "instance exception may not have a separate value");
24250 type = (PyObject*) Py_TYPE(type);
24252 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24253 PyErr_SetString(PyExc_TypeError,
24254 "raise: exception class must be a subclass of BaseException");
24258 __Pyx_PyThreadState_assign
24259 __Pyx_ErrRestore(type, value, tb);
24268 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24269 PyObject* owned_instance = NULL;
24270 if (tb == Py_None) {
24272 }
else if (tb && !PyTraceBack_Check(tb)) {
24273 PyErr_SetString(PyExc_TypeError,
24274 "raise: arg 3 must be a traceback or None");
24277 if (value == Py_None)
24279 if (PyExceptionInstance_Check(type)) {
24281 PyErr_SetString(PyExc_TypeError,
24282 "instance exception may not have a separate value");
24286 type = (PyObject*) Py_TYPE(value);
24287 }
else if (PyExceptionClass_Check(type)) {
24288 PyObject *instance_class = NULL;
24289 if (value && PyExceptionInstance_Check(value)) {
24290 instance_class = (PyObject*) Py_TYPE(value);
24291 if (instance_class != type) {
24292 int is_subclass = PyObject_IsSubclass(instance_class, type);
24293 if (!is_subclass) {
24294 instance_class = NULL;
24295 }
else if (unlikely(is_subclass == -1)) {
24298 type = instance_class;
24302 if (!instance_class) {
24305 args = PyTuple_New(0);
24306 else if (PyTuple_Check(value)) {
24310 args = PyTuple_Pack(1, value);
24313 owned_instance = PyObject_Call(type, args, NULL);
24315 if (!owned_instance)
24317 value = owned_instance;
24318 if (!PyExceptionInstance_Check(value)) {
24319 PyErr_Format(PyExc_TypeError,
24320 "calling %R should have returned an instance of "
24321 "BaseException, not %R",
24322 type, Py_TYPE(value));
24327 PyErr_SetString(PyExc_TypeError,
24328 "raise: exception class must be a subclass of BaseException");
24332 PyObject *fixed_cause;
24333 if (cause == Py_None) {
24334 fixed_cause = NULL;
24335 }
else if (PyExceptionClass_Check(cause)) {
24336 fixed_cause = PyObject_CallObject(cause, NULL);
24337 if (fixed_cause == NULL)
24339 }
else if (PyExceptionInstance_Check(cause)) {
24340 fixed_cause = cause;
24341 Py_INCREF(fixed_cause);
24343 PyErr_SetString(PyExc_TypeError,
24344 "exception causes must derive from "
24348 PyException_SetCause(value, fixed_cause);
24350 PyErr_SetObject(type, value);
24352 #if CYTHON_FAST_THREAD_STATE
24353 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24354 PyObject* tmp_tb = tstate->curexc_traceback;
24355 if (tb != tmp_tb) {
24357 tstate->curexc_traceback = tb;
24358 Py_XDECREF(tmp_tb);
24361 PyObject *tmp_type, *tmp_value, *tmp_tb;
24362 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24364 PyErr_Restore(tmp_type, tmp_value, tb);
24365 Py_XDECREF(tmp_tb);
24369 Py_XDECREF(owned_instance);
24375 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
24379 #if PY_MAJOR_VERSION < 3
24380 if (likely(PyInt_CheckExact(op1))) {
24381 const long b = intval;
24382 long a = PyInt_AS_LONG(op1);
24383 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24386 #if CYTHON_USE_PYLONG_INTERNALS
24387 if (likely(PyLong_CheckExact(op1))) {
24389 unsigned long uintval;
24390 Py_ssize_t size = Py_SIZE(op1);
24391 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24393 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24394 }
else if (intval < 0) {
24403 uintval = (
unsigned long) intval;
24404 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24405 if (uintval >> (PyLong_SHIFT * 4)) {
24406 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24407 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24410 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24411 if (uintval >> (PyLong_SHIFT * 3)) {
24412 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24413 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24416 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24417 if (uintval >> (PyLong_SHIFT * 2)) {
24418 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24419 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24422 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24423 if (uintval >> (PyLong_SHIFT * 1)) {
24424 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24425 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24428 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
24429 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24432 if (PyFloat_CheckExact(op1)) {
24433 const long b = intval;
24434 double a = PyFloat_AS_DOUBLE(op1);
24435 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24438 PyObject_RichCompare(op1, op2, Py_NE));
24442 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
24443 #if CYTHON_COMPILING_IN_PYPY
24444 return PyObject_RichCompareBool(s1, s2, equals);
24447 return (equals == Py_EQ);
24448 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24449 const char *ps1, *ps2;
24450 Py_ssize_t length = PyBytes_GET_SIZE(s1);
24451 if (length != PyBytes_GET_SIZE(s2))
24452 return (equals == Py_NE);
24453 ps1 = PyBytes_AS_STRING(s1);
24454 ps2 = PyBytes_AS_STRING(s2);
24455 if (ps1[0] != ps2[0]) {
24456 return (equals == Py_NE);
24457 }
else if (length == 1) {
24458 return (equals == Py_EQ);
24461 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24462 Py_hash_t hash1, hash2;
24463 hash1 = ((PyBytesObject*)s1)->ob_shash;
24464 hash2 = ((PyBytesObject*)s2)->ob_shash;
24465 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24466 return (equals == Py_NE);
24469 result = memcmp(ps1, ps2, (
size_t)length);
24470 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24472 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24473 return (equals == Py_NE);
24474 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24475 return (equals == Py_NE);
24478 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24481 result = __Pyx_PyObject_IsTrue(py_result);
24482 Py_DECREF(py_result);
24489 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24490 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24491 PyObject *dict = Py_TYPE(obj)->tp_dict;
24492 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24494 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24495 PyObject **dictptr = NULL;
24496 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24498 #if CYTHON_COMPILING_IN_CPYTHON
24499 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24501 dictptr = _PyObject_GetDictPtr(obj);
24504 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24506 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24507 PyObject *dict = Py_TYPE(obj)->tp_dict;
24508 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24510 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24515 #if CYTHON_USE_DICT_VERSIONS
24516 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24518 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24522 #if !CYTHON_AVOID_BORROWED_REFS
24523 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24524 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24525 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24526 if (likely(result)) {
24527 return __Pyx_NewRef(result);
24528 }
else if (unlikely(PyErr_Occurred())) {
24532 result = PyDict_GetItem(__pyx_d, name);
24533 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24534 if (likely(result)) {
24535 return __Pyx_NewRef(result);
24539 result = PyObject_GetItem(__pyx_d, name);
24540 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24541 if (likely(result)) {
24542 return __Pyx_NewRef(result);
24546 return __Pyx_GetBuiltinName(name);
24550 #if CYTHON_FAST_PYCCALL
24551 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24552 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24553 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24554 PyObject *
self = PyCFunction_GET_SELF(func);
24555 int flags = PyCFunction_GET_FLAGS(func);
24556 assert(PyCFunction_Check(func));
24557 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24558 assert(nargs >= 0);
24559 assert(nargs == 0 || args != NULL);
24563 assert(!PyErr_Occurred());
24564 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24565 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24567 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24573 #if CYTHON_FAST_PYCALL
24574 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24575 PyObject *globals) {
24577 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24578 PyObject **fastlocals;
24581 assert(globals != NULL);
24586 assert(tstate != NULL);
24587 f = PyFrame_New(tstate, co, globals, NULL);
24591 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24592 for (i = 0; i < na; i++) {
24594 fastlocals[i] = *args++;
24596 result = PyEval_EvalFrameEx(f,0);
24597 ++tstate->recursion_depth;
24599 --tstate->recursion_depth;
24602 #if 1 || PY_VERSION_HEX < 0x030600B1
24603 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24604 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24605 PyObject *globals = PyFunction_GET_GLOBALS(func);
24606 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24608 #if PY_MAJOR_VERSION >= 3
24611 PyObject *kwtuple, **k;
24616 assert(kwargs == NULL || PyDict_Check(kwargs));
24617 nk = kwargs ? PyDict_Size(kwargs) : 0;
24618 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24622 #
if PY_MAJOR_VERSION >= 3
24623 co->co_kwonlyargcount == 0 &&
24625 likely(kwargs == NULL || nk == 0) &&
24626 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24627 if (argdefs == NULL && co->co_argcount == nargs) {
24628 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24631 else if (nargs == 0 && argdefs != NULL
24632 && co->co_argcount == Py_SIZE(argdefs)) {
24635 args = &PyTuple_GET_ITEM(argdefs, 0);
24636 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24640 if (kwargs != NULL) {
24642 kwtuple = PyTuple_New(2 * nk);
24643 if (kwtuple == NULL) {
24647 k = &PyTuple_GET_ITEM(kwtuple, 0);
24649 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24660 closure = PyFunction_GET_CLOSURE(func);
24661 #if PY_MAJOR_VERSION >= 3
24662 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24664 if (argdefs != NULL) {
24665 d = &PyTuple_GET_ITEM(argdefs, 0);
24666 nd = Py_SIZE(argdefs);
24672 #if PY_MAJOR_VERSION >= 3
24673 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24676 d, (
int)nd, kwdefs, closure);
24678 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24681 d, (
int)nd, closure);
24683 Py_XDECREF(kwtuple);
24685 Py_LeaveRecursiveCall();
24692 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24693 PyObject *args, *result = NULL;
24694 #if CYTHON_FAST_PYCALL
24695 if (PyFunction_Check(
function)) {
24696 PyObject *args[2] = {arg1, arg2};
24697 return __Pyx_PyFunction_FastCall(
function, args, 2);
24700 #if CYTHON_FAST_PYCCALL
24701 if (__Pyx_PyFastCFunction_Check(
function)) {
24702 PyObject *args[2] = {arg1, arg2};
24703 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24706 args = PyTuple_New(2);
24707 if (unlikely(!args))
goto done;
24709 PyTuple_SET_ITEM(args, 0, arg1);
24711 PyTuple_SET_ITEM(args, 1, arg2);
24712 Py_INCREF(
function);
24713 result = __Pyx_PyObject_Call(
function, args, NULL);
24715 Py_DECREF(
function);
24721 #if CYTHON_COMPILING_IN_CPYTHON
24722 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24723 PyObject *
self, *result;
24725 cfunc = PyCFunction_GET_FUNCTION(func);
24726 self = PyCFunction_GET_SELF(func);
24727 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24729 result = cfunc(
self, arg);
24730 Py_LeaveRecursiveCall();
24731 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24734 "NULL result without error in PyObject_Call");
24741 #if CYTHON_COMPILING_IN_CPYTHON
24742 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24744 PyObject *args = PyTuple_New(1);
24745 if (unlikely(!args))
return NULL;
24747 PyTuple_SET_ITEM(args, 0, arg);
24748 result = __Pyx_PyObject_Call(func, args, NULL);
24752 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24753 #if CYTHON_FAST_PYCALL
24754 if (PyFunction_Check(func)) {
24755 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24758 if (likely(PyCFunction_Check(func))) {
24759 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24760 return __Pyx_PyObject_CallMethO(func, arg);
24761 #if CYTHON_FAST_PYCCALL
24762 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24763 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24767 return __Pyx__PyObject_CallOneArg(func, arg);
24770 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24772 PyObject *args = PyTuple_Pack(1, arg);
24773 if (unlikely(!args))
return NULL;
24774 result = __Pyx_PyObject_Call(func, args, NULL);
24781 #if CYTHON_COMPILING_IN_CPYTHON
24782 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24783 #if CYTHON_FAST_PYCALL
24784 if (PyFunction_Check(func)) {
24785 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24788 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
24789 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24791 if (likely(PyCFunction_Check(func)))
24794 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24795 return __Pyx_PyObject_CallMethO(func, NULL);
24798 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24803 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24805 if (!j)
return NULL;
24806 r = PyObject_GetItem(o, j);
24810 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24811 CYTHON_NCP_UNUSED
int wraparound,
24812 CYTHON_NCP_UNUSED
int boundscheck) {
24813 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24814 Py_ssize_t wrapped_i = i;
24815 if (wraparound & unlikely(i < 0)) {
24816 wrapped_i += PyList_GET_SIZE(o);
24818 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24819 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24823 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24825 return PySequence_GetItem(o, i);
24828 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24829 CYTHON_NCP_UNUSED
int wraparound,
24830 CYTHON_NCP_UNUSED
int boundscheck) {
24831 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24832 Py_ssize_t wrapped_i = i;
24833 if (wraparound & unlikely(i < 0)) {
24834 wrapped_i += PyTuple_GET_SIZE(o);
24836 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24837 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24841 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24843 return PySequence_GetItem(o, i);
24846 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24847 CYTHON_NCP_UNUSED
int wraparound,
24848 CYTHON_NCP_UNUSED
int boundscheck) {
24849 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24850 if (is_list || PyList_CheckExact(o)) {
24851 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24852 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24853 PyObject *r = PyList_GET_ITEM(o, n);
24858 else if (PyTuple_CheckExact(o)) {
24859 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24860 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24861 PyObject *r = PyTuple_GET_ITEM(o, n);
24866 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24867 if (likely(m && m->sq_item)) {
24868 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24869 Py_ssize_t l = m->sq_length(o);
24870 if (likely(l >= 0)) {
24873 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24878 return m->sq_item(o, i);
24882 if (is_list || PySequence_Check(o)) {
24883 return PySequence_GetItem(o, i);
24886 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24890 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24891 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24893 value = PyDict_GetItemWithError(d, key);
24894 if (unlikely(!value)) {
24895 if (!PyErr_Occurred()) {
24896 if (unlikely(PyTuple_Check(key))) {
24897 PyObject* args = PyTuple_Pack(1, key);
24898 if (likely(args)) {
24899 PyErr_SetObject(PyExc_KeyError, args);
24903 PyErr_SetObject(PyExc_KeyError, key);
24915 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24917 __Pyx_memviewslice *memviewslice,
24918 int memview_is_new_reference)
24920 __Pyx_RefNannyDeclarations
24922 Py_buffer *buf = &memview->view;
24923 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24924 if (unlikely(memviewslice->memview || memviewslice->data)) {
24925 PyErr_SetString(PyExc_ValueError,
24926 "memviewslice is already initialized!");
24929 if (buf->strides) {
24930 for (i = 0; i < ndim; i++) {
24931 memviewslice->strides[i] = buf->strides[i];
24934 Py_ssize_t stride = buf->itemsize;
24935 for (i = ndim - 1; i >= 0; i--) {
24936 memviewslice->strides[i] = stride;
24937 stride *= buf->shape[i];
24940 for (i = 0; i < ndim; i++) {
24941 memviewslice->shape[i] = buf->shape[i];
24942 if (buf->suboffsets) {
24943 memviewslice->suboffsets[i] = buf->suboffsets[i];
24945 memviewslice->suboffsets[i] = -1;
24948 memviewslice->memview = memview;
24949 memviewslice->data = (
char *)buf->buf;
24950 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24951 Py_INCREF(memview);
24956 memviewslice->memview = 0;
24957 memviewslice->data = 0;
24960 __Pyx_RefNannyFinishContext();
24963 #ifndef Py_NO_RETURN
24964 #define Py_NO_RETURN
24966 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24969 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
24970 va_start(vargs, fmt);
24974 vsnprintf(msg, 200, fmt, vargs);
24976 Py_FatalError(msg);
24978 static CYTHON_INLINE
int
24979 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24980 PyThread_type_lock lock)
24983 PyThread_acquire_lock(lock, 1);
24984 result = (*acquisition_count)++;
24985 PyThread_release_lock(lock);
24988 static CYTHON_INLINE
int
24989 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24990 PyThread_type_lock lock)
24993 PyThread_acquire_lock(lock, 1);
24994 result = (*acquisition_count)--;
24995 PyThread_release_lock(lock);
24998 static CYTHON_INLINE
void
24999 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
25002 struct __pyx_memoryview_obj *memview = memslice->memview;
25003 if (unlikely(!memview || (PyObject *) memview == Py_None))
25005 if (unlikely(__pyx_get_slice_count(memview) < 0))
25006 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25007 __pyx_get_slice_count(memview), lineno);
25008 first_time = __pyx_add_acquisition_count(memview) == 0;
25009 if (unlikely(first_time)) {
25011 Py_INCREF((PyObject *) memview);
25013 PyGILState_STATE _gilstate = PyGILState_Ensure();
25014 Py_INCREF((PyObject *) memview);
25015 PyGILState_Release(_gilstate);
25019 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
25020 int have_gil,
int lineno) {
25022 struct __pyx_memoryview_obj *memview = memslice->memview;
25023 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
25024 memslice->memview = NULL;
25027 if (unlikely(__pyx_get_slice_count(memview) <= 0))
25028 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
25029 __pyx_get_slice_count(memview), lineno);
25030 last_time = __pyx_sub_acquisition_count(memview) == 1;
25031 memslice->data = NULL;
25032 if (unlikely(last_time)) {
25034 Py_CLEAR(memslice->memview);
25036 PyGILState_STATE _gilstate = PyGILState_Ensure();
25037 Py_CLEAR(memslice->memview);
25038 PyGILState_Release(_gilstate);
25041 memslice->memview = NULL;
25046 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
25048 if (unlikely(!type)) {
25049 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25053 #if PY_MAJOR_VERSION == 2
25054 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
25058 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
25060 PyErr_Format(PyExc_TypeError,
25061 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25062 name, type->tp_name, Py_TYPE(obj)->tp_name);
25067 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
25068 #if CYTHON_COMPILING_IN_PYPY
25069 return PyObject_RichCompareBool(s1, s2, equals);
25071 #if PY_MAJOR_VERSION < 3
25072 PyObject* owned_ref = NULL;
25074 int s1_is_unicode, s2_is_unicode;
25078 s1_is_unicode = PyUnicode_CheckExact(s1);
25079 s2_is_unicode = PyUnicode_CheckExact(s2);
25080 #if PY_MAJOR_VERSION < 3
25081 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25082 owned_ref = PyUnicode_FromObject(s2);
25083 if (unlikely(!owned_ref))
25087 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25088 owned_ref = PyUnicode_FromObject(s1);
25089 if (unlikely(!owned_ref))
25093 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25094 return __Pyx_PyBytes_Equals(s1, s2, equals);
25097 if (s1_is_unicode & s2_is_unicode) {
25100 void *data1, *data2;
25101 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25103 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25104 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25107 #if CYTHON_USE_UNICODE_INTERNALS
25109 Py_hash_t hash1, hash2;
25110 #if CYTHON_PEP393_ENABLED
25111 hash1 = ((PyASCIIObject*)s1)->hash;
25112 hash2 = ((PyASCIIObject*)s2)->hash;
25114 hash1 = ((PyUnicodeObject*)s1)->hash;
25115 hash2 = ((PyUnicodeObject*)s2)->hash;
25117 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25122 kind = __Pyx_PyUnicode_KIND(s1);
25123 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25126 data1 = __Pyx_PyUnicode_DATA(s1);
25127 data2 = __Pyx_PyUnicode_DATA(s2);
25128 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25130 }
else if (length == 1) {
25133 int result = memcmp(data1, data2, (
size_t)(length * kind));
25134 #if PY_MAJOR_VERSION < 3
25135 Py_XDECREF(owned_ref);
25137 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25139 }
else if ((s1 == Py_None) & s2_is_unicode) {
25141 }
else if ((s2 == Py_None) & s1_is_unicode) {
25145 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25146 #if PY_MAJOR_VERSION < 3
25147 Py_XDECREF(owned_ref);
25151 result = __Pyx_PyObject_IsTrue(py_result);
25152 Py_DECREF(py_result);
25156 #if PY_MAJOR_VERSION < 3
25157 Py_XDECREF(owned_ref);
25159 return (equals == Py_EQ);
25161 #if PY_MAJOR_VERSION < 3
25162 Py_XDECREF(owned_ref);
25164 return (equals == Py_NE);
25169 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
25170 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
25171 int full_traceback, CYTHON_UNUSED
int nogil) {
25172 PyObject *old_exc, *old_val, *old_tb;
25174 __Pyx_PyThreadState_declare
25176 PyGILState_STATE state;
25178 state = PyGILState_Ensure();
25179 else state = (PyGILState_STATE)0;
25181 __Pyx_PyThreadState_assign
25182 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25183 if (full_traceback) {
25184 Py_XINCREF(old_exc);
25185 Py_XINCREF(old_val);
25186 Py_XINCREF(old_tb);
25187 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25190 #if PY_MAJOR_VERSION < 3
25191 ctx = PyString_FromString(name);
25193 ctx = PyUnicode_FromString(name);
25195 __Pyx_ErrRestore(old_exc, old_val, old_tb);
25197 PyErr_WriteUnraisable(Py_None);
25199 PyErr_WriteUnraisable(ctx);
25204 PyGILState_Release(state);
25209 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25210 #if CYTHON_USE_TYPE_SLOTS
25211 #if PY_MAJOR_VERSION >= 3
25212 if (likely(PyUnicode_Check(n)))
25214 if (likely(PyString_Check(n)))
25216 return __Pyx_PyObject_GetAttrStr(o, n);
25218 return PyObject_GetAttr(o, n);
25222 #if CYTHON_USE_TYPE_SLOTS
25223 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25224 PyObject *runerr = NULL;
25225 Py_ssize_t key_value;
25226 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25227 if (unlikely(!(m && m->sq_item))) {
25228 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25231 key_value = __Pyx_PyIndex_AsSsize_t(index);
25232 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25233 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25235 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25237 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25241 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25242 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25243 if (likely(m && m->mp_subscript)) {
25244 return m->mp_subscript(obj, key);
25246 return __Pyx_PyObject_GetIndex(obj, key);
25251 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25252 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25253 const char* encoding,
const char* errors,
25254 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
25256 if (unlikely((start < 0) | (stop < 0))) {
25257 size_t slen = strlen(cstring);
25258 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
25259 PyErr_SetString(PyExc_OverflowError,
25260 "c-string too long to convert to Python");
25263 length = (Py_ssize_t) slen;
25272 if (unlikely(stop <= start))
25273 return __Pyx_NewRef(__pyx_empty_unicode);
25274 length = stop - start;
25277 return decode_func(cstring, length, errors);
25279 return PyUnicode_Decode(cstring, length, encoding, errors);
25284 #if CYTHON_FAST_THREAD_STATE
25285 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25287 n = PyTuple_GET_SIZE(tuple);
25288 #if PY_MAJOR_VERSION >= 3
25289 for (i=0; i<n; i++) {
25290 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25293 for (i=0; i<n; i++) {
25294 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25298 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25299 PyObject *exc_type = tstate->curexc_type;
25300 if (exc_type == err)
return 1;
25301 if (unlikely(!exc_type))
return 0;
25302 if (unlikely(PyTuple_Check(err)))
25303 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25304 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25309 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25310 __Pyx_PyThreadState_declare
25311 __Pyx_PyThreadState_assign
25312 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25314 __Pyx_PyErr_Clear();
25318 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25319 PyObject *r = __Pyx_GetAttr(o, n);
25320 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25324 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25325 PyErr_Format(PyExc_ValueError,
25326 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25330 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25331 PyErr_Format(PyExc_ValueError,
25332 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25333 index, (index == 1) ?
"" :
"s");
25337 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25338 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25342 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25343 if (unlikely(!type)) {
25344 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25347 if (likely(__Pyx_TypeCheck(obj, type)))
25349 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25350 Py_TYPE(obj)->tp_name, type->tp_name);
25355 #if CYTHON_USE_EXC_INFO_STACK
25356 static _PyErr_StackItem *
25357 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25359 _PyErr_StackItem *exc_info = tstate->exc_info;
25360 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25361 exc_info->previous_item != NULL)
25363 exc_info = exc_info->previous_item;
25370 #if CYTHON_FAST_THREAD_STATE
25371 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25372 #if CYTHON_USE_EXC_INFO_STACK
25373 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25374 *type = exc_info->exc_type;
25375 *value = exc_info->exc_value;
25376 *tb = exc_info->exc_traceback;
25378 *type = tstate->exc_type;
25379 *value = tstate->exc_value;
25380 *tb = tstate->exc_traceback;
25383 Py_XINCREF(*value);
25386 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25387 PyObject *tmp_type, *tmp_value, *tmp_tb;
25388 #if CYTHON_USE_EXC_INFO_STACK
25389 _PyErr_StackItem *exc_info = tstate->exc_info;
25390 tmp_type = exc_info->exc_type;
25391 tmp_value = exc_info->exc_value;
25392 tmp_tb = exc_info->exc_traceback;
25393 exc_info->exc_type = type;
25394 exc_info->exc_value = value;
25395 exc_info->exc_traceback = tb;
25397 tmp_type = tstate->exc_type;
25398 tmp_value = tstate->exc_value;
25399 tmp_tb = tstate->exc_traceback;
25400 tstate->exc_type = type;
25401 tstate->exc_value = value;
25402 tstate->exc_traceback = tb;
25404 Py_XDECREF(tmp_type);
25405 Py_XDECREF(tmp_value);
25406 Py_XDECREF(tmp_tb);
25411 #if CYTHON_FAST_THREAD_STATE
25412 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25414 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25417 PyObject *local_type, *local_value, *local_tb;
25418 #if CYTHON_FAST_THREAD_STATE
25419 PyObject *tmp_type, *tmp_value, *tmp_tb;
25420 local_type = tstate->curexc_type;
25421 local_value = tstate->curexc_value;
25422 local_tb = tstate->curexc_traceback;
25423 tstate->curexc_type = 0;
25424 tstate->curexc_value = 0;
25425 tstate->curexc_traceback = 0;
25427 PyErr_Fetch(&local_type, &local_value, &local_tb);
25429 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25430 #if CYTHON_FAST_THREAD_STATE
25431 if (unlikely(tstate->curexc_type))
25433 if (unlikely(PyErr_Occurred()))
25436 #if PY_MAJOR_VERSION >= 3
25438 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25442 Py_XINCREF(local_tb);
25443 Py_XINCREF(local_type);
25444 Py_XINCREF(local_value);
25445 *type = local_type;
25446 *value = local_value;
25448 #if CYTHON_FAST_THREAD_STATE
25449 #if CYTHON_USE_EXC_INFO_STACK
25451 _PyErr_StackItem *exc_info = tstate->exc_info;
25452 tmp_type = exc_info->exc_type;
25453 tmp_value = exc_info->exc_value;
25454 tmp_tb = exc_info->exc_traceback;
25455 exc_info->exc_type = local_type;
25456 exc_info->exc_value = local_value;
25457 exc_info->exc_traceback = local_tb;
25460 tmp_type = tstate->exc_type;
25461 tmp_value = tstate->exc_value;
25462 tmp_tb = tstate->exc_traceback;
25463 tstate->exc_type = local_type;
25464 tstate->exc_value = local_value;
25465 tstate->exc_traceback = local_tb;
25467 Py_XDECREF(tmp_type);
25468 Py_XDECREF(tmp_value);
25469 Py_XDECREF(tmp_tb);
25471 PyErr_SetExcInfo(local_type, local_value, local_tb);
25478 Py_XDECREF(local_type);
25479 Py_XDECREF(local_value);
25480 Py_XDECREF(local_tb);
25485 #if CYTHON_FAST_THREAD_STATE
25486 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25487 PyObject *tmp_type, *tmp_value, *tmp_tb;
25488 #if CYTHON_USE_EXC_INFO_STACK
25489 _PyErr_StackItem *exc_info = tstate->exc_info;
25490 tmp_type = exc_info->exc_type;
25491 tmp_value = exc_info->exc_value;
25492 tmp_tb = exc_info->exc_traceback;
25493 exc_info->exc_type = *type;
25494 exc_info->exc_value = *value;
25495 exc_info->exc_traceback = *tb;
25497 tmp_type = tstate->exc_type;
25498 tmp_value = tstate->exc_value;
25499 tmp_tb = tstate->exc_traceback;
25500 tstate->exc_type = *type;
25501 tstate->exc_value = *value;
25502 tstate->exc_traceback = *tb;
25505 *value = tmp_value;
25509 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25510 PyObject *tmp_type, *tmp_value, *tmp_tb;
25511 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25512 PyErr_SetExcInfo(*type, *value, *tb);
25514 *value = tmp_value;
25520 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25521 PyObject *empty_list = 0;
25522 PyObject *module = 0;
25523 PyObject *global_dict = 0;
25524 PyObject *empty_dict = 0;
25526 #if PY_MAJOR_VERSION < 3
25527 PyObject *py_import;
25528 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25535 empty_list = PyList_New(0);
25540 global_dict = PyModule_GetDict(__pyx_m);
25543 empty_dict = PyDict_New();
25547 #if PY_MAJOR_VERSION >= 3
25549 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25550 module = PyImport_ImportModuleLevelObject(
25551 name, global_dict, empty_dict, list, 1);
25553 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25562 #if PY_MAJOR_VERSION < 3
25563 PyObject *py_level = PyInt_FromLong(level);
25566 module = PyObject_CallFunctionObjArgs(py_import,
25567 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25568 Py_DECREF(py_level);
25570 module = PyImport_ImportModuleLevelObject(
25571 name, global_dict, empty_dict, list, level);
25576 #if PY_MAJOR_VERSION < 3
25577 Py_XDECREF(py_import);
25579 Py_XDECREF(empty_list);
25580 Py_XDECREF(empty_dict);
25585 #if CYTHON_COMPILING_IN_CPYTHON
25586 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25592 return b == &PyBaseObject_Type;
25594 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25596 if (a == b)
return 1;
25600 n = PyTuple_GET_SIZE(mro);
25601 for (i = 0; i < n; i++) {
25602 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25607 return __Pyx_InBases(a, b);
25609 #if PY_MAJOR_VERSION == 2
25610 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25611 PyObject *exception, *value, *tb;
25613 __Pyx_PyThreadState_declare
25614 __Pyx_PyThreadState_assign
25615 __Pyx_ErrFetch(&exception, &value, &tb);
25616 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25617 if (unlikely(res == -1)) {
25618 PyErr_WriteUnraisable(err);
25622 res = PyObject_IsSubclass(err, exc_type2);
25623 if (unlikely(res == -1)) {
25624 PyErr_WriteUnraisable(err);
25628 __Pyx_ErrRestore(exception, value, tb);
25632 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25633 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25635 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25640 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25642 assert(PyExceptionClass_Check(exc_type));
25643 n = PyTuple_GET_SIZE(tuple);
25644 #if PY_MAJOR_VERSION >= 3
25645 for (i=0; i<n; i++) {
25646 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25649 for (i=0; i<n; i++) {
25650 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25651 #if PY_MAJOR_VERSION < 3
25652 if (likely(exc_type == t))
return 1;
25654 if (likely(PyExceptionClass_Check(t))) {
25655 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25661 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25662 if (likely(err == exc_type))
return 1;
25663 if (likely(PyExceptionClass_Check(err))) {
25664 if (likely(PyExceptionClass_Check(exc_type))) {
25665 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25666 }
else if (likely(PyTuple_Check(exc_type))) {
25667 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25671 return PyErr_GivenExceptionMatches(err, exc_type);
25673 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25674 assert(PyExceptionClass_Check(exc_type1));
25675 assert(PyExceptionClass_Check(exc_type2));
25676 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25677 if (likely(PyExceptionClass_Check(err))) {
25678 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25680 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25685 #if !CYTHON_COMPILING_IN_PYPY
25686 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
25688 (void)zerodivision_check;
25689 #if PY_MAJOR_VERSION < 3
25690 if (likely(PyInt_CheckExact(op1))) {
25691 const long b = intval;
25693 long a = PyInt_AS_LONG(op1);
25694 x = (long)((
unsigned long)a + b);
25695 if (likely((x^a) >= 0 || (x^b) >= 0))
25696 return PyInt_FromLong(x);
25697 return PyLong_Type.tp_as_number->nb_add(op1, op2);
25700 #if CYTHON_USE_PYLONG_INTERNALS
25701 if (likely(PyLong_CheckExact(op1))) {
25702 const long b = intval;
25704 #ifdef HAVE_LONG_LONG
25705 const PY_LONG_LONG llb = intval;
25706 PY_LONG_LONG lla, llx;
25708 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25709 const Py_ssize_t size = Py_SIZE(op1);
25710 if (likely(__Pyx_sst_abs(size) <= 1)) {
25711 a = likely(size) ? digits[0] : 0;
25712 if (size == -1) a = -a;
25716 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25717 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25719 #ifdef HAVE_LONG_LONG
25720 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25721 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25725 CYTHON_FALLTHROUGH;
25727 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25728 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25730 #ifdef HAVE_LONG_LONG
25731 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25732 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25736 CYTHON_FALLTHROUGH;
25738 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25739 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25741 #ifdef HAVE_LONG_LONG
25742 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25743 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25747 CYTHON_FALLTHROUGH;
25749 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25750 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25752 #ifdef HAVE_LONG_LONG
25753 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25754 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25758 CYTHON_FALLTHROUGH;
25760 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25761 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25763 #ifdef HAVE_LONG_LONG
25764 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25765 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25769 CYTHON_FALLTHROUGH;
25771 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25772 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25774 #ifdef HAVE_LONG_LONG
25775 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25776 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25780 CYTHON_FALLTHROUGH;
25781 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
25785 return PyLong_FromLong(x);
25786 #ifdef HAVE_LONG_LONG
25789 return PyLong_FromLongLong(llx);
25795 if (PyFloat_CheckExact(op1)) {
25796 const long b = intval;
25797 double a = PyFloat_AS_DOUBLE(op1);
25799 PyFPE_START_PROTECT(
"add",
return NULL)
25800 result = ((double)a) + (double)b;
25801 PyFPE_END_PROTECT(result)
25802 return PyFloat_FromDouble(result);
25804 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25809 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25810 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25814 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25815 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25816 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25817 PyErr_Format(PyExc_ImportError,
25818 #
if PY_MAJOR_VERSION < 3
25819 "cannot import name %.230s", PyString_AS_STRING(name));
25821 "cannot import name %S", name);
25828 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25830 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25831 PyErr_SetString(PyExc_TypeError,
25832 "hasattr(): attribute name must be string");
25835 r = __Pyx_GetAttr(o, n);
25836 if (unlikely(!r)) {
25846 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
25847 PyTypeObject* type = Py_TYPE(obj);
25848 while (type && type->tp_dealloc != current_tp_dealloc)
25849 type = type->tp_base;
25850 while (type && type->tp_dealloc == current_tp_dealloc)
25851 type = type->tp_base;
25853 type->tp_dealloc(obj);
25857 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse) {
25858 PyTypeObject* type = Py_TYPE(obj);
25859 while (type && type->tp_traverse != current_tp_traverse)
25860 type = type->tp_base;
25861 while (type && type->tp_traverse == current_tp_traverse)
25862 type = type->tp_base;
25863 if (type && type->tp_traverse)
25864 return type->tp_traverse(obj, v, a);
25869 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
25870 PyTypeObject* type = Py_TYPE(obj);
25871 while (type && type->tp_clear != current_tp_clear)
25872 type = type->tp_base;
25873 while (type && type->tp_clear == current_tp_clear)
25874 type = type->tp_base;
25875 if (type && type->tp_clear)
25876 type->tp_clear(obj);
25880 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25881 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25882 PyErr_Format(PyExc_AttributeError,
25883 #
if PY_MAJOR_VERSION >= 3
25884 "'%.50s' object has no attribute '%U'",
25885 tp->tp_name, attr_name);
25887 "'%.50s' object has no attribute '%.400s'",
25888 tp->tp_name, PyString_AS_STRING(attr_name));
25892 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25894 PyTypeObject *tp = Py_TYPE(obj);
25895 if (unlikely(!PyString_Check(attr_name))) {
25896 return PyObject_GenericGetAttr(obj, attr_name);
25898 assert(!tp->tp_dictoffset);
25899 descr = _PyType_Lookup(tp, attr_name);
25900 if (unlikely(!descr)) {
25901 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25904 #if PY_MAJOR_VERSION < 3
25905 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25908 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25910 PyObject *res = f(descr, obj, (PyObject *)tp);
25920 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25921 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25922 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25923 return PyObject_GenericGetAttr(obj, attr_name);
25925 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25930 #ifndef __PYX_HAVE_RT_ImportType_0_29_36
25931 #define __PYX_HAVE_RT_ImportType_0_29_36
25932 static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject *module,
const char *module_name,
const char *class_name,
25933 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_0_29_36 check_size)
25935 PyObject *result = 0;
25937 Py_ssize_t basicsize;
25938 Py_ssize_t itemsize;
25939 #ifdef Py_LIMITED_API
25940 PyObject *py_basicsize;
25941 PyObject *py_itemsize;
25943 result = PyObject_GetAttrString(module, class_name);
25946 if (!PyType_Check(result)) {
25947 PyErr_Format(PyExc_TypeError,
25948 "%.200s.%.200s is not a type object",
25949 module_name, class_name);
25952 #ifndef Py_LIMITED_API
25953 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25954 itemsize = ((PyTypeObject *)result)->tp_itemsize;
25956 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25959 basicsize = PyLong_AsSsize_t(py_basicsize);
25960 Py_DECREF(py_basicsize);
25962 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25964 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
25967 itemsize = PyLong_AsSsize_t(py_itemsize);
25968 Py_DECREF(py_itemsize);
25970 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
25974 if (size % alignment) {
25975 alignment = size % alignment;
25977 if (itemsize < (Py_ssize_t)alignment)
25978 itemsize = (Py_ssize_t)alignment;
25980 if ((
size_t)(basicsize + itemsize) < size) {
25981 PyErr_Format(PyExc_ValueError,
25982 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25983 "Expected %zd from C header, got %zd from PyObject",
25984 module_name, class_name, size, basicsize);
25987 if (check_size == __Pyx_ImportType_CheckSize_Error_0_29_36 && (
size_t)basicsize != size) {
25988 PyErr_Format(PyExc_ValueError,
25989 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25990 "Expected %zd from C header, got %zd from PyObject",
25991 module_name, class_name, size, basicsize);
25994 else if (check_size == __Pyx_ImportType_CheckSize_Warn_0_29_36 && (
size_t)basicsize > size) {
25995 PyOS_snprintf(warning,
sizeof(warning),
25996 "%s.%s size changed, may indicate binary incompatibility. "
25997 "Expected %zd from C header, got %zd from PyObject",
25998 module_name, class_name, size, basicsize);
25999 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
26001 return (PyTypeObject *)result;
26003 Py_XDECREF(result);
26009 static void* __Pyx_GetVtable(PyObject *dict) {
26011 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
26014 #if PY_VERSION_HEX >= 0x02070000
26015 ptr = PyCapsule_GetPointer(ob, 0);
26017 ptr = PyCObject_AsVoidPtr(ob);
26019 if (!ptr && !PyErr_Occurred())
26020 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
26029 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26030 #if PY_VERSION_HEX >= 0x02070000
26031 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26033 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26037 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26047 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
26048 __Pyx_PyThreadState_declare
26049 __Pyx_PyThreadState_assign
26050 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26051 __Pyx_PyErr_Clear();
26053 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26055 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26056 PyTypeObject* tp = Py_TYPE(obj);
26057 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26058 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26061 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26062 if (unlikely(!result)) {
26063 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26069 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26071 PyObject *name_attr;
26072 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26073 if (likely(name_attr)) {
26074 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26078 if (unlikely(ret < 0)) {
26082 Py_XDECREF(name_attr);
26085 static int __Pyx_setup_reduce(PyObject* type_obj) {
26087 PyObject *object_reduce = NULL;
26088 PyObject *object_getstate = NULL;
26089 PyObject *object_reduce_ex = NULL;
26090 PyObject *reduce = NULL;
26091 PyObject *reduce_ex = NULL;
26092 PyObject *reduce_cython = NULL;
26093 PyObject *setstate = NULL;
26094 PyObject *setstate_cython = NULL;
26095 PyObject *getstate = NULL;
26096 #if CYTHON_USE_PYTYPE_LOOKUP
26097 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
26099 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
26100 if (!getstate && PyErr_Occurred()) {
26105 #if CYTHON_USE_PYTYPE_LOOKUP
26106 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
26108 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
26109 if (!object_getstate && PyErr_Occurred()) {
26113 if (object_getstate != getstate) {
26117 #if CYTHON_USE_PYTYPE_LOOKUP
26118 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26120 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
26122 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
26123 if (reduce_ex == object_reduce_ex) {
26124 #if CYTHON_USE_PYTYPE_LOOKUP
26125 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26127 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
26129 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
26130 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26131 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26132 if (likely(reduce_cython)) {
26133 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26134 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26135 }
else if (reduce == object_reduce || PyErr_Occurred()) {
26138 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26139 if (!setstate) PyErr_Clear();
26140 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26141 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26142 if (likely(setstate_cython)) {
26143 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26144 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
26145 }
else if (!setstate || PyErr_Occurred()) {
26149 PyType_Modified((PyTypeObject*)type_obj);
26154 if (!PyErr_Occurred())
26155 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26158 #if !CYTHON_USE_PYTYPE_LOOKUP
26159 Py_XDECREF(object_reduce);
26160 Py_XDECREF(object_reduce_ex);
26161 Py_XDECREF(object_getstate);
26162 Py_XDECREF(getstate);
26164 Py_XDECREF(reduce);
26165 Py_XDECREF(reduce_ex);
26166 Py_XDECREF(reduce_cython);
26167 Py_XDECREF(setstate);
26168 Py_XDECREF(setstate_cython);
26173 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
26174 PyObject* fake_module;
26175 PyTypeObject* cached_type = NULL;
26176 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
26177 if (!fake_module)
return NULL;
26178 Py_INCREF(fake_module);
26179 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
26181 if (!PyType_Check((PyObject*)cached_type)) {
26182 PyErr_Format(PyExc_TypeError,
26183 "Shared Cython type %.200s is not a type object",
26187 if (cached_type->tp_basicsize != type->tp_basicsize) {
26188 PyErr_Format(PyExc_TypeError,
26189 "Shared Cython type %.200s has the wrong size, try recompiling",
26194 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
26196 if (PyType_Ready(type) < 0)
goto bad;
26197 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
26200 cached_type = type;
26203 Py_DECREF(fake_module);
26204 return cached_type;
26206 Py_XDECREF(cached_type);
26207 cached_type = NULL;
26212 #include <structmember.h>
26214 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
26216 if (unlikely(op->func_doc == NULL)) {
26217 if (op->func.m_ml->ml_doc) {
26218 #if PY_MAJOR_VERSION >= 3
26219 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
26221 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
26223 if (unlikely(op->func_doc == NULL))
26226 Py_INCREF(Py_None);
26230 Py_INCREF(op->func_doc);
26231 return op->func_doc;
26234 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26236 PyObject *tmp = op->func_doc;
26237 if (value == NULL) {
26241 op->func_doc = value;
26246 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26248 if (unlikely(op->func_name == NULL)) {
26249 #if PY_MAJOR_VERSION >= 3
26250 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
26252 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
26254 if (unlikely(op->func_name == NULL))
26257 Py_INCREF(op->func_name);
26258 return op->func_name;
26261 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26264 #if PY_MAJOR_VERSION >= 3
26265 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26267 if (unlikely(value == NULL || !PyString_Check(value)))
26270 PyErr_SetString(PyExc_TypeError,
26271 "__name__ must be set to a string object");
26274 tmp = op->func_name;
26276 op->func_name = value;
26281 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26283 Py_INCREF(op->func_qualname);
26284 return op->func_qualname;
26287 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26290 #if PY_MAJOR_VERSION >= 3
26291 if (unlikely(value == NULL || !PyUnicode_Check(value)))
26293 if (unlikely(value == NULL || !PyString_Check(value)))
26296 PyErr_SetString(PyExc_TypeError,
26297 "__qualname__ must be set to a string object");
26300 tmp = op->func_qualname;
26302 op->func_qualname = value;
26307 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
26310 self = m->func_closure;
26317 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26319 if (unlikely(op->func_dict == NULL)) {
26320 op->func_dict = PyDict_New();
26321 if (unlikely(op->func_dict == NULL))
26324 Py_INCREF(op->func_dict);
26325 return op->func_dict;
26328 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
26331 if (unlikely(value == NULL)) {
26332 PyErr_SetString(PyExc_TypeError,
26333 "function's dictionary may not be deleted");
26336 if (unlikely(!PyDict_Check(value))) {
26337 PyErr_SetString(PyExc_TypeError,
26338 "setting function's dictionary to a non-dict");
26341 tmp = op->func_dict;
26343 op->func_dict = value;
26348 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26350 Py_INCREF(op->func_globals);
26351 return op->func_globals;
26354 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26356 Py_INCREF(Py_None);
26360 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
26362 PyObject* result = (op->func_code) ? op->func_code : Py_None;
26367 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
26369 PyObject *res = op->defaults_getter((PyObject *) op);
26370 if (unlikely(!res))
26372 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26373 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
26374 Py_INCREF(op->defaults_tuple);
26375 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
26376 Py_INCREF(op->defaults_kwdict);
26378 op->defaults_tuple = PySequence_ITEM(res, 0);
26379 if (unlikely(!op->defaults_tuple)) result = -1;
26381 op->defaults_kwdict = PySequence_ITEM(res, 1);
26382 if (unlikely(!op->defaults_kwdict)) result = -1;
26389 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26393 }
else if (value != Py_None && !PyTuple_Check(value)) {
26394 PyErr_SetString(PyExc_TypeError,
26395 "__defaults__ must be set to a tuple object");
26399 tmp = op->defaults_tuple;
26400 op->defaults_tuple = value;
26405 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26406 PyObject* result = op->defaults_tuple;
26407 if (unlikely(!result)) {
26408 if (op->defaults_getter) {
26409 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26410 result = op->defaults_tuple;
26419 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26423 }
else if (value != Py_None && !PyDict_Check(value)) {
26424 PyErr_SetString(PyExc_TypeError,
26425 "__kwdefaults__ must be set to a dict object");
26429 tmp = op->defaults_kwdict;
26430 op->defaults_kwdict = value;
26435 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26436 PyObject* result = op->defaults_kwdict;
26437 if (unlikely(!result)) {
26438 if (op->defaults_getter) {
26439 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26440 result = op->defaults_kwdict;
26449 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26451 if (!value || value == Py_None) {
26453 }
else if (!PyDict_Check(value)) {
26454 PyErr_SetString(PyExc_TypeError,
26455 "__annotations__ must be set to a dict object");
26459 tmp = op->func_annotations;
26460 op->func_annotations = value;
26465 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26466 PyObject* result = op->func_annotations;
26467 if (unlikely(!result)) {
26468 result = PyDict_New();
26469 if (unlikely(!result))
return NULL;
26470 op->func_annotations = result;
26475 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26476 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26477 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26478 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26479 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26480 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26481 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26482 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26483 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26484 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26485 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26486 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26487 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26488 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26489 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26490 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26491 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26492 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26493 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26496 static PyMemberDef __pyx_CyFunction_members[] = {
26497 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26501 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26503 #if PY_MAJOR_VERSION >= 3
26504 Py_INCREF(m->func_qualname);
26505 return m->func_qualname;
26507 return PyString_FromString(m->func.m_ml->ml_name);
26510 static PyMethodDef __pyx_CyFunction_methods[] = {
26511 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26514 #if PY_VERSION_HEX < 0x030500A0
26515 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26517 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26519 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
26520 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26521 if (unlikely(op == NULL))
26524 __Pyx_CyFunction_weakreflist(op) = NULL;
26525 op->func.m_ml = ml;
26526 op->func.m_self = (PyObject *) op;
26527 Py_XINCREF(closure);
26528 op->func_closure = closure;
26529 Py_XINCREF(module);
26530 op->func.m_module = module;
26531 op->func_dict = NULL;
26532 op->func_name = NULL;
26533 Py_INCREF(qualname);
26534 op->func_qualname = qualname;
26535 op->func_doc = NULL;
26536 op->func_classobj = NULL;
26537 op->func_globals = globals;
26538 Py_INCREF(op->func_globals);
26540 op->func_code = code;
26541 op->defaults_pyobjects = 0;
26542 op->defaults_size = 0;
26543 op->defaults = NULL;
26544 op->defaults_tuple = NULL;
26545 op->defaults_kwdict = NULL;
26546 op->defaults_getter = NULL;
26547 op->func_annotations = NULL;
26548 return (PyObject *) op;
26551 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26553 Py_CLEAR(m->func_closure);
26554 Py_CLEAR(m->func.m_module);
26555 Py_CLEAR(m->func_dict);
26556 Py_CLEAR(m->func_name);
26557 Py_CLEAR(m->func_qualname);
26558 Py_CLEAR(m->func_doc);
26559 Py_CLEAR(m->func_globals);
26560 Py_CLEAR(m->func_code);
26561 Py_CLEAR(m->func_classobj);
26562 Py_CLEAR(m->defaults_tuple);
26563 Py_CLEAR(m->defaults_kwdict);
26564 Py_CLEAR(m->func_annotations);
26566 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26568 for (i = 0; i < m->defaults_pyobjects; i++)
26569 Py_XDECREF(pydefaults[i]);
26570 PyObject_Free(m->defaults);
26571 m->defaults = NULL;
26575 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26577 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26578 PyObject_ClearWeakRefs((PyObject *) m);
26579 __Pyx_CyFunction_clear(m);
26580 PyObject_GC_Del(m);
26582 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26584 PyObject_GC_UnTrack(m);
26585 __Pyx__CyFunction_dealloc(m);
26587 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26589 Py_VISIT(m->func_closure);
26590 Py_VISIT(m->func.m_module);
26591 Py_VISIT(m->func_dict);
26592 Py_VISIT(m->func_name);
26593 Py_VISIT(m->func_qualname);
26594 Py_VISIT(m->func_doc);
26595 Py_VISIT(m->func_globals);
26596 Py_VISIT(m->func_code);
26597 Py_VISIT(m->func_classobj);
26598 Py_VISIT(m->defaults_tuple);
26599 Py_VISIT(m->defaults_kwdict);
26601 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26603 for (i = 0; i < m->defaults_pyobjects; i++)
26604 Py_VISIT(pydefaults[i]);
26608 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26610 #if PY_MAJOR_VERSION < 3
26611 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26612 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26616 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26618 type = (PyObject *)(Py_TYPE(obj));
26619 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26621 if (obj == Py_None)
26624 return __Pyx_PyMethod_New(func, obj, type);
26627 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26629 #if PY_MAJOR_VERSION >= 3
26630 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26631 op->func_qualname, (
void *)op);
26633 return PyString_FromFormat(
"<cyfunction %s at %p>",
26634 PyString_AsString(op->func_qualname), (
void *)op);
26637 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26638 PyCFunctionObject* f = (PyCFunctionObject*)func;
26639 PyCFunction meth = f->m_ml->ml_meth;
26641 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26643 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26644 return (*meth)(
self, arg);
26646 case METH_VARARGS | METH_KEYWORDS:
26647 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26649 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26650 size = PyTuple_GET_SIZE(arg);
26651 if (likely(size == 0))
26652 return (*meth)(
self, NULL);
26653 PyErr_Format(PyExc_TypeError,
26654 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26655 f->m_ml->ml_name, size);
26660 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26661 size = PyTuple_GET_SIZE(arg);
26662 if (likely(size == 1)) {
26663 PyObject *result, *arg0;
26664 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26665 arg0 = PyTuple_GET_ITEM(arg, 0);
26667 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26669 result = (*meth)(
self, arg0);
26670 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26675 PyErr_Format(PyExc_TypeError,
26676 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26677 f->m_ml->ml_name, size);
26682 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26683 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26684 "longer supported!");
26687 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26691 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26692 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26694 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26696 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26697 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26699 PyObject *new_args;
26701 argc = PyTuple_GET_SIZE(args);
26702 new_args = PyTuple_GetSlice(args, 1, argc);
26703 if (unlikely(!new_args))
26705 self = PyTuple_GetItem(args, 0);
26706 if (unlikely(!
self)) {
26707 Py_DECREF(new_args);
26708 #if PY_MAJOR_VERSION > 2
26709 PyErr_Format(PyExc_TypeError,
26710 "unbound method %.200S() needs an argument",
26711 cyfunc->func_qualname);
26713 PyErr_SetString(PyExc_TypeError,
26714 "unbound method needs an argument");
26718 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26719 Py_DECREF(new_args);
26721 result = __Pyx_CyFunction_Call(func, args, kw);
26725 static PyTypeObject __pyx_CyFunctionType_type = {
26726 PyVarObject_HEAD_INIT(0, 0)
26727 "cython_function_or_method",
26728 sizeof(__pyx_CyFunctionObject),
26730 (destructor) __Pyx_CyFunction_dealloc,
26734 #if PY_MAJOR_VERSION < 3
26739 (reprfunc) __Pyx_CyFunction_repr,
26744 __Pyx_CyFunction_CallAsMethod,
26749 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26751 (traverseproc) __Pyx_CyFunction_traverse,
26752 (inquiry) __Pyx_CyFunction_clear,
26754 #
if PY_VERSION_HEX < 0x030500A0
26755 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26757 offsetof(PyCFunctionObject, m_weakreflist),
26761 __pyx_CyFunction_methods,
26762 __pyx_CyFunction_members,
26763 __pyx_CyFunction_getsets,
26766 __Pyx_CyFunction_descr_get,
26768 offsetof(__pyx_CyFunctionObject, func_dict),
26781 #if PY_VERSION_HEX >= 0x030400a1
26784 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26787 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26790 #if PY_VERSION_HEX >= 0x030C0000
26793 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
26797 static int __pyx_CyFunction_init(
void) {
26798 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26799 if (unlikely(__pyx_CyFunctionType == NULL)) {
26804 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26805 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26806 m->defaults = PyObject_Malloc(size);
26807 if (unlikely(!m->defaults))
26808 return PyErr_NoMemory();
26809 memset(m->defaults, 0, size);
26810 m->defaults_pyobjects = pyobjects;
26811 m->defaults_size = size;
26812 return m->defaults;
26814 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26815 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26816 m->defaults_tuple = tuple;
26819 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26820 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26821 m->defaults_kwdict = dict;
26824 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26825 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26826 m->func_annotations = dict;
26831 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
26832 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26833 PyObject *op = __Pyx_CyFunction_Init(
26834 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26835 ml, flags, qualname, closure, module, globals, code
26838 PyObject_GC_Track(op);
26844 #ifndef CYTHON_CLINE_IN_TRACEBACK
26845 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
26846 PyObject *use_cline;
26847 PyObject *ptype, *pvalue, *ptraceback;
26848 #if CYTHON_COMPILING_IN_CPYTHON
26849 PyObject **cython_runtime_dict;
26851 if (unlikely(!__pyx_cython_runtime)) {
26854 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26855 #if CYTHON_COMPILING_IN_CPYTHON
26856 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26857 if (likely(cython_runtime_dict)) {
26858 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26859 use_cline, *cython_runtime_dict,
26860 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26864 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26865 if (use_cline_obj) {
26866 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26867 Py_DECREF(use_cline_obj);
26875 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26877 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26880 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26886 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26887 int start = 0, mid = 0, end = count - 1;
26888 if (end >= 0 && code_line > entries[end].code_line) {
26891 while (start < end) {
26892 mid = start + (end - start) / 2;
26893 if (code_line < entries[mid].code_line) {
26895 }
else if (code_line > entries[mid].code_line) {
26901 if (code_line <= entries[mid].code_line) {
26907 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26908 PyCodeObject* code_object;
26910 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26913 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26914 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26917 code_object = __pyx_code_cache.entries[pos].code_object;
26918 Py_INCREF(code_object);
26919 return code_object;
26921 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26923 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26924 if (unlikely(!code_line)) {
26927 if (unlikely(!entries)) {
26928 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26929 if (likely(entries)) {
26930 __pyx_code_cache.entries = entries;
26931 __pyx_code_cache.max_count = 64;
26932 __pyx_code_cache.count = 1;
26933 entries[0].code_line = code_line;
26934 entries[0].code_object = code_object;
26935 Py_INCREF(code_object);
26939 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26940 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26941 PyCodeObject* tmp = entries[pos].code_object;
26942 entries[pos].code_object = code_object;
26946 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26947 int new_max = __pyx_code_cache.max_count + 64;
26948 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26949 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26950 if (unlikely(!entries)) {
26953 __pyx_code_cache.entries = entries;
26954 __pyx_code_cache.max_count = new_max;
26956 for (i=__pyx_code_cache.count; i>pos; i--) {
26957 entries[i] = entries[i-1];
26959 entries[pos].code_line = code_line;
26960 entries[pos].code_object = code_object;
26961 __pyx_code_cache.count++;
26962 Py_INCREF(code_object);
26966 #include "compile.h"
26967 #include "frameobject.h"
26968 #include "traceback.h"
26969 #if PY_VERSION_HEX >= 0x030b00a6
26970 #ifndef Py_BUILD_CORE
26971 #define Py_BUILD_CORE 1
26973 #include "internal/pycore_frame.h"
26975 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26976 const char *funcname,
int c_line,
26977 int py_line,
const char *filename) {
26978 PyCodeObject *py_code = NULL;
26979 PyObject *py_funcname = NULL;
26980 #if PY_MAJOR_VERSION < 3
26981 PyObject *py_srcfile = NULL;
26982 py_srcfile = PyString_FromString(filename);
26983 if (!py_srcfile)
goto bad;
26986 #if PY_MAJOR_VERSION < 3
26987 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26988 if (!py_funcname)
goto bad;
26990 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26991 if (!py_funcname)
goto bad;
26992 funcname = PyUnicode_AsUTF8(py_funcname);
26993 if (!funcname)
goto bad;
26997 #if PY_MAJOR_VERSION < 3
26998 py_funcname = PyString_FromString(funcname);
26999 if (!py_funcname)
goto bad;
27002 #if PY_MAJOR_VERSION < 3
27003 py_code = __Pyx_PyCode_New(
27020 Py_DECREF(py_srcfile);
27022 py_code = PyCode_NewEmpty(filename, funcname, py_line);
27024 Py_XDECREF(py_funcname);
27027 Py_XDECREF(py_funcname);
27028 #if PY_MAJOR_VERSION < 3
27029 Py_XDECREF(py_srcfile);
27033 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
27034 int py_line,
const char *filename) {
27035 PyCodeObject *py_code = 0;
27036 PyFrameObject *py_frame = 0;
27037 PyThreadState *tstate = __Pyx_PyThreadState_Current;
27038 PyObject *ptype, *pvalue, *ptraceback;
27040 c_line = __Pyx_CLineForTraceback(tstate, c_line);
27042 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27044 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27045 py_code = __Pyx_CreateCodeObjectForTraceback(
27046 funcname, c_line, py_line, filename);
27051 Py_XDECREF(pvalue);
27052 Py_XDECREF(ptraceback);
27055 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27056 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27058 py_frame = PyFrame_New(
27064 if (!py_frame)
goto bad;
27065 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27066 PyTraceBack_Here(py_frame);
27068 Py_XDECREF(py_code);
27069 Py_XDECREF(py_frame);
27072 #if PY_MAJOR_VERSION < 3
27073 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
27074 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
27075 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
27076 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
27077 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27080 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27081 PyObject *obj = view->obj;
27083 if (PyObject_CheckBuffer(obj)) {
27084 PyBuffer_Release(view);
27096 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
27098 int i, index, step, start;
27099 Py_ssize_t itemsize = mvs.memview->view.itemsize;
27100 if (order ==
'F') {
27107 for (i = 0; i < ndim; i++) {
27108 index = start + step * i;
27109 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27111 itemsize *= mvs.shape[index];
27118 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27119 void **out_start,
void **out_end,
27120 int ndim,
size_t itemsize)
27124 start = end = slice->data;
27125 for (i = 0; i < ndim; i++) {
27126 Py_ssize_t stride = slice->strides[i];
27127 Py_ssize_t extent = slice->shape[i];
27129 *out_start = *out_end = start;
27133 end += stride * (extent - 1);
27135 start += stride * (extent - 1);
27138 *out_start = start;
27139 *out_end = end + itemsize;
27142 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27143 __Pyx_memviewslice *slice2,
27144 int ndim,
size_t itemsize)
27146 void *start1, *end1, *start2, *end2;
27147 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27148 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27149 return (start1 < end2) && (start2 < end1);
27153 static CYTHON_INLINE PyObject *
27154 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
27157 #if PY_VERSION_HEX >= 0x02070000
27158 cobj = PyCapsule_New(p, sig, NULL);
27160 cobj = PyCObject_FromVoidPtr(p, NULL);
27166 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27167 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27168 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27169 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27170 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27172 func_type value = func_value;\
27173 if (sizeof(target_type) < sizeof(func_type)) {\
27174 if (unlikely(value != (func_type) (target_type) value)) {\
27175 func_type zero = 0;\
27176 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27177 return (target_type) -1;\
27178 if (is_unsigned && unlikely(value < zero))\
27179 goto raise_neg_overflow;\
27181 goto raise_overflow;\
27184 return (target_type) value;\
27188 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
27194 S.u32 = 0x01020304;
27195 return S.u8[0] == 4;
27199 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27200 __Pyx_BufFmt_StackElem* stack,
27201 __Pyx_TypeInfo* type) {
27202 stack[0].field = &ctx->root;
27203 stack[0].parent_offset = 0;
27204 ctx->root.type = type;
27205 ctx->root.name =
"buffer dtype";
27206 ctx->root.offset = 0;
27208 ctx->head->field = &ctx->root;
27209 ctx->fmt_offset = 0;
27210 ctx->head->parent_offset = 0;
27211 ctx->new_packmode =
'@';
27212 ctx->enc_packmode =
'@';
27213 ctx->new_count = 1;
27214 ctx->enc_count = 0;
27216 ctx->is_complex = 0;
27217 ctx->is_valid_array = 0;
27218 ctx->struct_alignment = 0;
27219 while (type->typegroup ==
'S') {
27221 ctx->head->field = type->fields;
27222 ctx->head->parent_offset = 0;
27223 type = type->fields->type;
27226 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
27228 const char* t = *ts;
27229 if (*t < '0' || *t >
'9') {
27232 count = *t++ -
'0';
27233 while (*t >=
'0' && *t <=
'9') {
27235 count += *t++ -
'0';
27241 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
27242 int number = __Pyx_BufFmt_ParseNumber(ts);
27244 PyErr_Format(PyExc_ValueError,\
27245 "Does not understand character buffer dtype format string ('%c')", **ts);
27248 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
27249 PyErr_Format(PyExc_ValueError,
27250 "Unexpected format string character: '%c'", ch);
27252 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
27254 case '?':
return "'bool'";
27255 case 'c':
return "'char'";
27256 case 'b':
return "'signed char'";
27257 case 'B':
return "'unsigned char'";
27258 case 'h':
return "'short'";
27259 case 'H':
return "'unsigned short'";
27260 case 'i':
return "'int'";
27261 case 'I':
return "'unsigned int'";
27262 case 'l':
return "'long'";
27263 case 'L':
return "'unsigned long'";
27264 case 'q':
return "'long long'";
27265 case 'Q':
return "'unsigned long long'";
27266 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
27267 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
27268 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
27269 case 'T':
return "a struct";
27270 case 'O':
return "Python object";
27271 case 'P':
return "a pointer";
27272 case 's':
case 'p':
return "a string";
27273 case 0:
return "end";
27274 default:
return "unparseable format string";
27277 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
27279 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27280 case 'h':
case 'H':
return 2;
27281 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
27282 case 'q':
case 'Q':
return 8;
27283 case 'f':
return (is_complex ? 8 : 4);
27284 case 'd':
return (is_complex ? 16 : 8);
27286 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
27289 case 'O':
case 'P':
return sizeof(
void*);
27291 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27295 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
27297 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27298 case 'h':
case 'H':
return sizeof(short);
27299 case 'i':
case 'I':
return sizeof(int);
27300 case 'l':
case 'L':
return sizeof(long);
27301 #ifdef HAVE_LONG_LONG
27302 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
27304 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
27305 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
27306 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
27307 case 'O':
case 'P':
return sizeof(
void*);
27309 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27314 typedef struct {
char c;
short x; } __Pyx_st_short;
27315 typedef struct {
char c;
int x; } __Pyx_st_int;
27316 typedef struct {
char c;
long x; } __Pyx_st_long;
27317 typedef struct {
char c;
float x; } __Pyx_st_float;
27318 typedef struct {
char c;
double x; } __Pyx_st_double;
27319 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
27320 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
27321 #ifdef HAVE_LONG_LONG
27322 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27324 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
27326 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27327 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
27328 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
27329 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
27330 #ifdef HAVE_LONG_LONG
27331 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
27333 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
27334 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
27335 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
27336 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
27338 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27346 typedef struct {
short x;
char c; } __Pyx_pad_short;
27347 typedef struct {
int x;
char c; } __Pyx_pad_int;
27348 typedef struct {
long x;
char c; } __Pyx_pad_long;
27349 typedef struct {
float x;
char c; } __Pyx_pad_float;
27350 typedef struct {
double x;
char c; } __Pyx_pad_double;
27351 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
27352 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
27353 #ifdef HAVE_LONG_LONG
27354 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
27356 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
27358 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
27359 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
27360 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
27361 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
27362 #ifdef HAVE_LONG_LONG
27363 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
27365 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
27366 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
27367 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
27368 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
27370 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27374 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
27378 case 'b':
case 'h':
case 'i':
27379 case 'l':
case 'q':
case 's':
case 'p':
27381 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
27383 case 'f':
case 'd':
case 'g':
27384 return (is_complex ?
'C' :
'R');
27390 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27395 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27396 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27397 const char* expected;
27399 if (ctx->head == NULL) {
27403 expected = ctx->head->field->type->name;
27406 PyErr_Format(PyExc_ValueError,
27407 "Buffer dtype mismatch, expected %s%s%s but got %s",
27408 quote, expected, quote,
27409 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27411 __Pyx_StructField* field = ctx->head->field;
27412 __Pyx_StructField* parent = (ctx->head - 1)->field;
27413 PyErr_Format(PyExc_ValueError,
27414 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27415 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27416 parent->type->name, field->name);
27419 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27421 size_t size, offset, arraysize = 1;
27422 if (ctx->enc_type == 0)
return 0;
27423 if (ctx->head->field->type->arraysize[0]) {
27425 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27426 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27428 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27429 PyErr_Format(PyExc_ValueError,
27430 "Expected a dimension of size %zu, got %zu",
27431 ctx->head->field->type->arraysize[0], ctx->enc_count);
27435 if (!ctx->is_valid_array) {
27436 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27437 ctx->head->field->type->ndim, ndim);
27440 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27441 arraysize *= ctx->head->field->type->arraysize[i];
27443 ctx->is_valid_array = 0;
27444 ctx->enc_count = 1;
27446 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27448 __Pyx_StructField* field = ctx->head->field;
27449 __Pyx_TypeInfo* type = field->type;
27450 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27451 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27453 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27455 if (ctx->enc_packmode ==
'@') {
27456 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27457 size_t align_mod_offset;
27458 if (align_at == 0)
return -1;
27459 align_mod_offset = ctx->fmt_offset % align_at;
27460 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27461 if (ctx->struct_alignment == 0)
27462 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27465 if (type->size != size || type->typegroup != group) {
27466 if (type->typegroup ==
'C' && type->fields != NULL) {
27467 size_t parent_offset = ctx->head->parent_offset + field->offset;
27469 ctx->head->field = type->fields;
27470 ctx->head->parent_offset = parent_offset;
27473 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27475 __Pyx_BufFmt_RaiseExpected(ctx);
27479 offset = ctx->head->parent_offset + field->offset;
27480 if (ctx->fmt_offset != offset) {
27481 PyErr_Format(PyExc_ValueError,
27482 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27483 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27486 ctx->fmt_offset += size;
27488 ctx->fmt_offset += (arraysize - 1) * size;
27491 if (field == &ctx->root) {
27493 if (ctx->enc_count != 0) {
27494 __Pyx_BufFmt_RaiseExpected(ctx);
27499 ctx->head->field = ++field;
27500 if (field->type == NULL) {
27502 field = ctx->head->field;
27504 }
else if (field->type->typegroup ==
'S') {
27505 size_t parent_offset = ctx->head->parent_offset + field->offset;
27506 if (field->type->fields->type == NULL)
continue;
27507 field = field->type->fields;
27509 ctx->head->field = field;
27510 ctx->head->parent_offset = parent_offset;
27516 }
while (ctx->enc_count);
27518 ctx->is_complex = 0;
27522 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27524 const char *ts = *tsp;
27525 int i = 0, number, ndim;
27527 if (ctx->new_count != 1) {
27528 PyErr_SetString(PyExc_ValueError,
27529 "Cannot handle repeated arrays in format string");
27532 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27533 ndim = ctx->head->field->type->ndim;
27534 while (*ts && *ts !=
')') {
27536 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27539 number = __Pyx_BufFmt_ExpectNumber(&ts);
27540 if (number == -1)
return NULL;
27541 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
27542 return PyErr_Format(PyExc_ValueError,
27543 "Expected a dimension of size %zu, got %d",
27544 ctx->head->field->type->arraysize[i], number);
27545 if (*ts !=
',' && *ts !=
')')
27546 return PyErr_Format(PyExc_ValueError,
27547 "Expected a comma in format string, got '%c'", *ts);
27548 if (*ts ==
',') ts++;
27552 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27553 ctx->head->field->type->ndim, i);
27555 PyErr_SetString(PyExc_ValueError,
27556 "Unexpected end of format string, expected ')'");
27559 ctx->is_valid_array = 1;
27560 ctx->new_count = 1;
27564 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27569 if (ctx->enc_type != 0 && ctx->head == NULL) {
27570 __Pyx_BufFmt_RaiseExpected(ctx);
27573 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27574 if (ctx->head != NULL) {
27575 __Pyx_BufFmt_RaiseExpected(ctx);
27585 if (!__Pyx_Is_Little_Endian()) {
27586 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27589 ctx->new_packmode =
'=';
27594 if (__Pyx_Is_Little_Endian()) {
27595 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27598 ctx->new_packmode =
'=';
27604 ctx->new_packmode = *ts++;
27608 const char* ts_after_sub;
27609 size_t i, struct_count = ctx->new_count;
27610 size_t struct_alignment = ctx->struct_alignment;
27611 ctx->new_count = 1;
27614 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27617 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27619 ctx->enc_count = 0;
27620 ctx->struct_alignment = 0;
27623 for (i = 0; i != struct_count; ++i) {
27624 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27625 if (!ts_after_sub)
return NULL;
27628 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27633 size_t alignment = ctx->struct_alignment;
27635 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27637 if (alignment && ctx->fmt_offset % alignment) {
27638 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27643 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27644 ctx->fmt_offset += ctx->new_count;
27645 ctx->new_count = 1;
27646 ctx->enc_count = 0;
27648 ctx->enc_packmode = ctx->new_packmode;
27654 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27655 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27658 CYTHON_FALLTHROUGH;
27659 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27660 case 'l':
case 'L':
case 'q':
case 'Q':
27661 case 'f':
case 'd':
case 'g':
27662 case 'O':
case 'p':
27663 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27664 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27665 ctx->enc_count += ctx->new_count;
27666 ctx->new_count = 1;
27671 CYTHON_FALLTHROUGH;
27673 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27674 ctx->enc_count = ctx->new_count;
27675 ctx->enc_packmode = ctx->new_packmode;
27676 ctx->enc_type = *ts;
27677 ctx->is_complex = got_Z;
27679 ctx->new_count = 1;
27684 while(*ts !=
':') ++ts;
27688 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27692 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27693 if (number == -1)
return NULL;
27694 ctx->new_count = (size_t)number;
27702 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27709 if (a->size != b->size || a->typegroup != b->typegroup ||
27710 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27711 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27712 return a->size == b->size;
27718 for (i = 0; i < a->ndim; i++)
27719 if (a->arraysize[i] != b->arraysize[i])
27722 if (a->typegroup ==
'S') {
27723 if (a->flags != b->flags)
27725 if (a->fields || b->fields) {
27726 if (!(a->fields && b->fields))
27728 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27729 __Pyx_StructField *field_a = a->fields + i;
27730 __Pyx_StructField *field_b = b->fields + i;
27731 if (field_a->offset != field_b->offset ||
27732 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27735 return !a->fields[i].type && !b->fields[i].type;
27743 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27745 if (buf->shape[dim] <= 1)
27747 if (buf->strides) {
27748 if (spec & __Pyx_MEMVIEW_CONTIG) {
27749 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27750 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
27751 PyErr_Format(PyExc_ValueError,
27752 "Buffer is not indirectly contiguous "
27753 "in dimension %d.", dim);
27756 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27757 PyErr_SetString(PyExc_ValueError,
27758 "Buffer and memoryview are not contiguous "
27759 "in the same dimension.");
27763 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27764 Py_ssize_t stride = buf->strides[dim];
27767 if (unlikely(stride < buf->itemsize)) {
27768 PyErr_SetString(PyExc_ValueError,
27769 "Buffer and memoryview are not contiguous "
27770 "in the same dimension.");
27775 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27776 PyErr_Format(PyExc_ValueError,
27777 "C-contiguous buffer is not contiguous in "
27778 "dimension %d", dim);
27780 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27781 PyErr_Format(PyExc_ValueError,
27782 "C-contiguous buffer is not indirect in "
27783 "dimension %d", dim);
27785 }
else if (unlikely(buf->suboffsets)) {
27786 PyErr_SetString(PyExc_ValueError,
27787 "Buffer exposes suboffsets but no strides");
27796 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27798 if (spec & __Pyx_MEMVIEW_DIRECT) {
27799 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27800 PyErr_Format(PyExc_ValueError,
27801 "Buffer not compatible with direct access "
27802 "in dimension %d.", dim);
27806 if (spec & __Pyx_MEMVIEW_PTR) {
27807 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27808 PyErr_Format(PyExc_ValueError,
27809 "Buffer is not indirectly accessible "
27810 "in dimension %d.", dim);
27819 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27822 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27823 Py_ssize_t stride = 1;
27824 for (i = 0; i < ndim; i++) {
27825 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27826 PyErr_SetString(PyExc_ValueError,
27827 "Buffer not fortran contiguous.");
27830 stride = stride * buf->shape[i];
27832 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27833 Py_ssize_t stride = 1;
27834 for (i = ndim - 1; i >- 1; i--) {
27835 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27836 PyErr_SetString(PyExc_ValueError,
27837 "Buffer not C contiguous.");
27840 stride = stride * buf->shape[i];
27847 static int __Pyx_ValidateAndInit_memviewslice(
27852 __Pyx_TypeInfo *dtype,
27853 __Pyx_BufFmt_StackElem stack[],
27854 __Pyx_memviewslice *memviewslice,
27855 PyObject *original_obj)
27857 struct __pyx_memoryview_obj *memview, *new_memview;
27858 __Pyx_RefNannyDeclarations
27860 int i, spec = 0, retval = -1;
27861 __Pyx_BufFmt_Context ctx;
27862 int from_memoryview = __pyx_memoryview_check(original_obj);
27863 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27864 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27865 original_obj)->typeinfo)) {
27866 memview = (
struct __pyx_memoryview_obj *) original_obj;
27867 new_memview = NULL;
27869 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27870 original_obj, buf_flags, 0, dtype);
27871 new_memview = memview;
27872 if (unlikely(!memview))
27875 buf = &memview->view;
27876 if (unlikely(buf->ndim != ndim)) {
27877 PyErr_Format(PyExc_ValueError,
27878 "Buffer has wrong number of dimensions (expected %d, got %d)",
27883 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27884 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
27886 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
27887 PyErr_Format(PyExc_ValueError,
27888 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27889 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27891 (buf->itemsize > 1) ?
"s" :
"",
27894 (dtype->size > 1) ?
"s" :
"");
27897 if (buf->len > 0) {
27898 for (i = 0; i < ndim; i++) {
27899 spec = axes_specs[i];
27900 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27902 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27905 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27908 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27909 new_memview != NULL) == -1)) {
27915 Py_XDECREF(new_memview);
27918 __Pyx_RefNannyFinishContext();
27923 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj,
int writable_flag) {
27924 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27925 __Pyx_BufFmt_StackElem stack[1];
27926 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27928 if (obj == Py_None) {
27929 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27932 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27933 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27934 &__Pyx_TypeInfo_float, stack,
27936 if (unlikely(retcode == -1))
27940 result.memview = NULL;
27941 result.data = NULL;
27946 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj,
int writable_flag) {
27947 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27948 __Pyx_BufFmt_StackElem stack[1];
27949 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27951 if (obj == Py_None) {
27952 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27955 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27956 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27957 &__Pyx_TypeInfo_float, stack,
27959 if (unlikely(retcode == -1))
27963 result.memview = NULL;
27964 result.data = NULL;
27969 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj,
int writable_flag) {
27970 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27971 __Pyx_BufFmt_StackElem stack[1];
27972 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27974 if (obj == Py_None) {
27975 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27978 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27979 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27980 &__Pyx_TypeInfo_double, stack,
27982 if (unlikely(retcode == -1))
27986 result.memview = NULL;
27987 result.data = NULL;
27992 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj,
int writable_flag) {
27993 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27994 __Pyx_BufFmt_StackElem stack[1];
27995 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27997 if (obj == Py_None) {
27998 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28001 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
28002 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
28003 &__Pyx_TypeInfo_double, stack,
28005 if (unlikely(retcode == -1))
28009 result.memview = NULL;
28010 result.data = NULL;
28015 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj,
int writable_flag) {
28016 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28017 __Pyx_BufFmt_StackElem stack[1];
28018 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
28020 if (obj == Py_None) {
28021 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28024 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
28025 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
28026 &__Pyx_TypeInfo_long__double, stack,
28028 if (unlikely(retcode == -1))
28032 result.memview = NULL;
28033 result.data = NULL;
28038 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj,
int writable_flag) {
28039 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28040 __Pyx_BufFmt_StackElem stack[1];
28041 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
28043 if (obj == Py_None) {
28044 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28047 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
28048 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
28049 &__Pyx_TypeInfo_long__double, stack,
28051 if (unlikely(retcode == -1))
28055 result.memview = NULL;
28056 result.data = NULL;
28061 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
28062 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28063 __Pyx_BufFmt_StackElem stack[1];
28064 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28066 if (obj == Py_None) {
28067 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28070 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28071 PyBUF_RECORDS_RO | writable_flag, 1,
28072 &__Pyx_TypeInfo_int, stack,
28074 if (unlikely(retcode == -1))
28078 result.memview = NULL;
28079 result.data = NULL;
28084 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
28085 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28086 __Pyx_BufFmt_StackElem stack[1];
28087 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28089 if (obj == Py_None) {
28090 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28093 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28094 PyBUF_RECORDS_RO | writable_flag, 1,
28095 &__Pyx_TypeInfo_float, stack,
28097 if (unlikely(retcode == -1))
28101 result.memview = NULL;
28102 result.data = NULL;
28107 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
28108 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28109 __Pyx_BufFmt_StackElem stack[1];
28110 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28112 if (obj == Py_None) {
28113 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28116 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28117 PyBUF_RECORDS_RO | writable_flag, 1,
28118 &__Pyx_TypeInfo_double, stack,
28120 if (unlikely(retcode == -1))
28124 result.memview = NULL;
28125 result.data = NULL;
28130 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
28131 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28132 __Pyx_BufFmt_StackElem stack[1];
28133 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28135 if (obj == Py_None) {
28136 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
28139 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28140 PyBUF_RECORDS_RO | writable_flag, 1,
28141 &__Pyx_TypeInfo_long__double, stack,
28143 if (unlikely(retcode == -1))
28147 result.memview = NULL;
28148 result.data = NULL;
28153 static __Pyx_memviewslice
28154 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
28155 const char *mode,
int ndim,
28156 size_t sizeof_dtype,
int contig_flag,
28157 int dtype_is_object)
28159 __Pyx_RefNannyDeclarations
28161 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28162 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28163 Py_buffer *buf = &from_memview->view;
28164 PyObject *shape_tuple = NULL;
28165 PyObject *temp_int = NULL;
28166 struct __pyx_array_obj *array_obj = NULL;
28167 struct __pyx_memoryview_obj *memview_obj = NULL;
28168 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
28169 for (i = 0; i < ndim; i++) {
28170 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28171 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
28172 "indirect dimensions (axis %d)", i);
28176 shape_tuple = PyTuple_New(ndim);
28177 if (unlikely(!shape_tuple)) {
28180 __Pyx_GOTREF(shape_tuple);
28181 for(i = 0; i < ndim; i++) {
28182 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28183 if(unlikely(!temp_int)) {
28186 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28190 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28191 if (unlikely(!array_obj)) {
28194 __Pyx_GOTREF(array_obj);
28195 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28196 (PyObject *) array_obj, contig_flag,
28198 from_mvs->memview->typeinfo);
28199 if (unlikely(!memview_obj))
28201 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28203 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28204 dtype_is_object) < 0))
28208 __Pyx_XDECREF(new_mvs.memview);
28209 new_mvs.memview = NULL;
28210 new_mvs.data = NULL;
28212 __Pyx_XDECREF(shape_tuple);
28213 __Pyx_XDECREF(temp_int);
28214 __Pyx_XDECREF(array_obj);
28215 __Pyx_RefNannyFinishContext();
28220 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
28221 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28222 #pragma GCC diagnostic push
28223 #pragma GCC diagnostic ignored "-Wconversion"
28225 const long neg_one = (long) -1, const_zero = (
long) 0;
28226 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28227 #pragma GCC diagnostic pop
28229 const int is_unsigned = neg_one > const_zero;
28231 if (
sizeof(
long) <
sizeof(long)) {
28232 return PyInt_FromLong((
long) value);
28233 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28234 return PyLong_FromUnsignedLong((
unsigned long) value);
28235 #ifdef HAVE_LONG_LONG
28236 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28237 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28241 if (
sizeof(
long) <=
sizeof(
long)) {
28242 return PyInt_FromLong((
long) value);
28243 #ifdef HAVE_LONG_LONG
28244 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28245 return PyLong_FromLongLong((PY_LONG_LONG) value);
28250 int one = 1;
int little = (int)*(
unsigned char *)&one;
28251 unsigned char *bytes = (
unsigned char *)&value;
28252 return _PyLong_FromByteArray(bytes,
sizeof(
long),
28253 little, !is_unsigned);
28258 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28259 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28260 #pragma GCC diagnostic push
28261 #pragma GCC diagnostic ignored "-Wconversion"
28263 const int neg_one = (int) -1, const_zero = (
int) 0;
28264 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28265 #pragma GCC diagnostic pop
28267 const int is_unsigned = neg_one > const_zero;
28268 #if PY_MAJOR_VERSION < 3
28269 if (likely(PyInt_Check(x))) {
28270 if (
sizeof(
int) <
sizeof(long)) {
28271 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28273 long val = PyInt_AS_LONG(x);
28274 if (is_unsigned && unlikely(val < 0)) {
28275 goto raise_neg_overflow;
28281 if (likely(PyLong_Check(x))) {
28283 #if CYTHON_USE_PYLONG_INTERNALS
28284 const digit* digits = ((PyLongObject*)x)->ob_digit;
28285 switch (Py_SIZE(x)) {
28286 case 0:
return (
int) 0;
28287 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
28289 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28290 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28291 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28292 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
28293 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28298 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28299 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28300 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28301 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
28302 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28307 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28308 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28309 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28310 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
28311 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28317 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28318 if (unlikely(Py_SIZE(x) < 0)) {
28319 goto raise_neg_overflow;
28323 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28324 if (unlikely(result < 0))
28326 if (unlikely(result == 1))
28327 goto raise_neg_overflow;
28330 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28331 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
28332 #ifdef HAVE_LONG_LONG
28333 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28334 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28338 #if CYTHON_USE_PYLONG_INTERNALS
28339 const digit* digits = ((PyLongObject*)x)->ob_digit;
28340 switch (Py_SIZE(x)) {
28341 case 0:
return (
int) 0;
28342 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
28343 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
28345 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
28346 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28347 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28348 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28349 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28354 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28355 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28356 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28357 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28358 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28363 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28364 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28365 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28366 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28367 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28372 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28373 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28374 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28375 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28376 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28381 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28382 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28383 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28384 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28385 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28390 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28391 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28392 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28393 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28394 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28400 if (
sizeof(
int) <=
sizeof(long)) {
28401 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28402 #ifdef HAVE_LONG_LONG
28403 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28404 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28409 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28410 PyErr_SetString(PyExc_RuntimeError,
28411 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28414 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28415 #if PY_MAJOR_VERSION < 3
28416 if (likely(v) && !PyLong_Check(v)) {
28418 v = PyNumber_Long(tmp);
28423 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28424 unsigned char *bytes = (
unsigned char *)&val;
28425 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28426 bytes,
sizeof(val),
28427 is_little, !is_unsigned);
28437 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28438 if (!tmp)
return (
int) -1;
28439 val = __Pyx_PyInt_As_int(tmp);
28444 PyErr_SetString(PyExc_OverflowError,
28445 "value too large to convert to int");
28447 raise_neg_overflow:
28448 PyErr_SetString(PyExc_OverflowError,
28449 "can't convert negative value to int");
28454 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28455 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28456 #pragma GCC diagnostic push
28457 #pragma GCC diagnostic ignored "-Wconversion"
28459 const long neg_one = (long) -1, const_zero = (
long) 0;
28460 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28461 #pragma GCC diagnostic pop
28463 const int is_unsigned = neg_one > const_zero;
28464 #if PY_MAJOR_VERSION < 3
28465 if (likely(PyInt_Check(x))) {
28466 if (
sizeof(
long) <
sizeof(long)) {
28467 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28469 long val = PyInt_AS_LONG(x);
28470 if (is_unsigned && unlikely(val < 0)) {
28471 goto raise_neg_overflow;
28477 if (likely(PyLong_Check(x))) {
28479 #if CYTHON_USE_PYLONG_INTERNALS
28480 const digit* digits = ((PyLongObject*)x)->ob_digit;
28481 switch (Py_SIZE(x)) {
28482 case 0:
return (
long) 0;
28483 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28485 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28486 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28487 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28488 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28489 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28494 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28495 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28496 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28497 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28498 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28503 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28504 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28505 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28506 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28507 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28513 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28514 if (unlikely(Py_SIZE(x) < 0)) {
28515 goto raise_neg_overflow;
28519 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28520 if (unlikely(result < 0))
28522 if (unlikely(result == 1))
28523 goto raise_neg_overflow;
28526 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28527 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28528 #ifdef HAVE_LONG_LONG
28529 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28530 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28534 #if CYTHON_USE_PYLONG_INTERNALS
28535 const digit* digits = ((PyLongObject*)x)->ob_digit;
28536 switch (Py_SIZE(x)) {
28537 case 0:
return (
long) 0;
28538 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28539 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28541 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28542 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28543 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28544 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28545 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28550 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28551 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28552 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28553 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28554 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28559 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28560 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28561 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28562 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28563 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28568 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28569 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28570 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28571 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28572 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28577 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28578 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28579 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28580 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28581 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28586 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28587 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28588 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28589 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28590 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28596 if (
sizeof(
long) <=
sizeof(long)) {
28597 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28598 #ifdef HAVE_LONG_LONG
28599 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28600 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28605 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28606 PyErr_SetString(PyExc_RuntimeError,
28607 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28610 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28611 #if PY_MAJOR_VERSION < 3
28612 if (likely(v) && !PyLong_Check(v)) {
28614 v = PyNumber_Long(tmp);
28619 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28620 unsigned char *bytes = (
unsigned char *)&val;
28621 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28622 bytes,
sizeof(val),
28623 is_little, !is_unsigned);
28633 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28634 if (!tmp)
return (
long) -1;
28635 val = __Pyx_PyInt_As_long(tmp);
28640 PyErr_SetString(PyExc_OverflowError,
28641 "value too large to convert to long");
28643 raise_neg_overflow:
28644 PyErr_SetString(PyExc_OverflowError,
28645 "can't convert negative value to long");
28650 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28651 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28652 #pragma GCC diagnostic push
28653 #pragma GCC diagnostic ignored "-Wconversion"
28655 const int neg_one = (int) -1, const_zero = (
int) 0;
28656 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28657 #pragma GCC diagnostic pop
28659 const int is_unsigned = neg_one > const_zero;
28661 if (
sizeof(
int) <
sizeof(long)) {
28662 return PyInt_FromLong((
long) value);
28663 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28664 return PyLong_FromUnsignedLong((
unsigned long) value);
28665 #ifdef HAVE_LONG_LONG
28666 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28667 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28671 if (
sizeof(
int) <=
sizeof(
long)) {
28672 return PyInt_FromLong((
long) value);
28673 #ifdef HAVE_LONG_LONG
28674 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28675 return PyLong_FromLongLong((PY_LONG_LONG) value);
28680 int one = 1;
int little = (int)*(
unsigned char *)&one;
28681 unsigned char *bytes = (
unsigned char *)&value;
28682 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28683 little, !is_unsigned);
28688 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28689 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28690 #pragma GCC diagnostic push
28691 #pragma GCC diagnostic ignored "-Wconversion"
28693 const char neg_one = (char) -1, const_zero = (
char) 0;
28694 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28695 #pragma GCC diagnostic pop
28697 const int is_unsigned = neg_one > const_zero;
28698 #if PY_MAJOR_VERSION < 3
28699 if (likely(PyInt_Check(x))) {
28700 if (
sizeof(
char) <
sizeof(long)) {
28701 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28703 long val = PyInt_AS_LONG(x);
28704 if (is_unsigned && unlikely(val < 0)) {
28705 goto raise_neg_overflow;
28711 if (likely(PyLong_Check(x))) {
28713 #if CYTHON_USE_PYLONG_INTERNALS
28714 const digit* digits = ((PyLongObject*)x)->ob_digit;
28715 switch (Py_SIZE(x)) {
28716 case 0:
return (
char) 0;
28717 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28719 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28720 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28721 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28722 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28723 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28728 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28729 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28730 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28731 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28732 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28737 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28738 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28739 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28740 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28741 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28747 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
28748 if (unlikely(Py_SIZE(x) < 0)) {
28749 goto raise_neg_overflow;
28753 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28754 if (unlikely(result < 0))
28756 if (unlikely(result == 1))
28757 goto raise_neg_overflow;
28760 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28761 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28762 #ifdef HAVE_LONG_LONG
28763 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28764 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28768 #if CYTHON_USE_PYLONG_INTERNALS
28769 const digit* digits = ((PyLongObject*)x)->ob_digit;
28770 switch (Py_SIZE(x)) {
28771 case 0:
return (
char) 0;
28772 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28773 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28775 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28776 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28777 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28778 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28779 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28784 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28785 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28786 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28787 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28788 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28793 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28794 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28795 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28796 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28797 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28802 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28803 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28804 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28805 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28806 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28811 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28812 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28813 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28814 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28815 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28820 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28821 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28822 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28823 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28824 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28830 if (
sizeof(
char) <=
sizeof(long)) {
28831 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28832 #ifdef HAVE_LONG_LONG
28833 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28834 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28839 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28840 PyErr_SetString(PyExc_RuntimeError,
28841 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28844 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28845 #if PY_MAJOR_VERSION < 3
28846 if (likely(v) && !PyLong_Check(v)) {
28848 v = PyNumber_Long(tmp);
28853 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28854 unsigned char *bytes = (
unsigned char *)&val;
28855 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28856 bytes,
sizeof(val),
28857 is_little, !is_unsigned);
28867 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28868 if (!tmp)
return (
char) -1;
28869 val = __Pyx_PyInt_As_char(tmp);
28874 PyErr_SetString(PyExc_OverflowError,
28875 "value too large to convert to char");
28877 raise_neg_overflow:
28878 PyErr_SetString(PyExc_OverflowError,
28879 "can't convert negative value to char");
28884 static int __Pyx_check_binary_version(
void) {
28886 int same=1, i, found_dot;
28887 const char* rt_from_call = Py_GetVersion();
28888 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28890 for (i = 0; i < 4; i++) {
28891 if (!ctversion[i]) {
28892 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
28895 if (rt_from_call[i] != ctversion[i]) {
28901 char rtversion[5] = {
'\0'};
28903 for (i=0; i<4; ++i) {
28904 if (rt_from_call[i] ==
'.') {
28905 if (found_dot)
break;
28907 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
28910 rtversion[i] = rt_from_call[i];
28912 PyOS_snprintf(message,
sizeof(message),
28913 "compiletime version %s of module '%.100s' "
28914 "does not match runtime version %s",
28915 ctversion, __Pyx_MODULE_NAME, rtversion);
28916 return PyErr_WarnEx(NULL, message, 1);
28922 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28924 #if PY_MAJOR_VERSION < 3
28925 if (t->is_unicode) {
28926 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28927 }
else if (t->intern) {
28928 *t->p = PyString_InternFromString(t->s);
28930 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28933 if (t->is_unicode | t->is_str) {
28935 *t->p = PyUnicode_InternFromString(t->s);
28936 }
else if (t->encoding) {
28937 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28939 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28942 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28947 if (PyObject_Hash(*t->p) == -1)
28954 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28955 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28957 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28959 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28961 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28962 #if !CYTHON_PEP393_ENABLED
28963 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28965 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28966 if (!defenc)
return NULL;
28967 defenc_c = PyBytes_AS_STRING(defenc);
28968 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28970 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28972 for (c = defenc_c; c < end; c++) {
28973 if ((
unsigned char) (*c) >= 128) {
28974 PyUnicode_AsASCIIString(o);
28980 *length = PyBytes_GET_SIZE(defenc);
28984 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28985 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28986 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28987 if (likely(PyUnicode_IS_ASCII(o))) {
28988 *length = PyUnicode_GET_LENGTH(o);
28989 return PyUnicode_AsUTF8(o);
28991 PyUnicode_AsASCIIString(o);
28995 return PyUnicode_AsUTF8AndSize(o, length);
29000 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29001 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29003 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29004 __Pyx_sys_getdefaultencoding_not_ascii &&
29006 PyUnicode_Check(o)) {
29007 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29010 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29011 if (PyByteArray_Check(o)) {
29012 *length = PyByteArray_GET_SIZE(o);
29013 return PyByteArray_AS_STRING(o);
29018 int r = PyBytes_AsStringAndSize(o, &result, length);
29019 if (unlikely(r < 0)) {
29026 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
29027 int is_true = x == Py_True;
29028 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
29029 else return PyObject_IsTrue(x);
29031 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29033 if (unlikely(!x))
return -1;
29034 retval = __Pyx_PyObject_IsTrue(x);
29038 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
29039 #if PY_MAJOR_VERSION >= 3
29040 if (PyLong_Check(result)) {
29041 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29042 "__int__ returned non-int (type %.200s). "
29043 "The ability to return an instance of a strict subclass of int "
29044 "is deprecated, and may be removed in a future version of Python.",
29045 Py_TYPE(result)->tp_name)) {
29052 PyErr_Format(PyExc_TypeError,
29053 "__%.4s__ returned non-%.4s (type %.200s)",
29054 type_name, type_name, Py_TYPE(result)->tp_name);
29058 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29059 #if CYTHON_USE_TYPE_SLOTS
29060 PyNumberMethods *m;
29062 const char *name = NULL;
29063 PyObject *res = NULL;
29064 #if PY_MAJOR_VERSION < 3
29065 if (likely(PyInt_Check(x) || PyLong_Check(x)))
29067 if (likely(PyLong_Check(x)))
29069 return __Pyx_NewRef(x);
29070 #if CYTHON_USE_TYPE_SLOTS
29071 m = Py_TYPE(x)->tp_as_number;
29072 #if PY_MAJOR_VERSION < 3
29073 if (m && m->nb_int) {
29075 res = m->nb_int(x);
29077 else if (m && m->nb_long) {
29079 res = m->nb_long(x);
29082 if (likely(m && m->nb_int)) {
29084 res = m->nb_int(x);
29088 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29089 res = PyNumber_Int(x);
29093 #if PY_MAJOR_VERSION < 3
29094 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29096 if (unlikely(!PyLong_CheckExact(res))) {
29098 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29101 else if (!PyErr_Occurred()) {
29102 PyErr_SetString(PyExc_TypeError,
29103 "an integer is required");
29107 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29110 #if PY_MAJOR_VERSION < 3
29111 if (likely(PyInt_CheckExact(b))) {
29112 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
29113 return PyInt_AS_LONG(b);
29115 return PyInt_AsSsize_t(b);
29118 if (likely(PyLong_CheckExact(b))) {
29119 #if CYTHON_USE_PYLONG_INTERNALS
29120 const digit* digits = ((PyLongObject*)b)->ob_digit;
29121 const Py_ssize_t size = Py_SIZE(b);
29122 if (likely(__Pyx_sst_abs(size) <= 1)) {
29123 ival = likely(size) ? digits[0] : 0;
29124 if (size == -1) ival = -ival;
29129 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29130 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29134 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29135 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29139 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29140 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29144 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29145 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29149 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29150 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
29154 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29155 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29161 return PyLong_AsSsize_t(b);
29163 x = PyNumber_Index(b);
29165 ival = PyInt_AsSsize_t(x);
29169 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
29170 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
29171 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
29172 #if PY_MAJOR_VERSION < 3
29173 }
else if (likely(PyInt_CheckExact(o))) {
29174 return PyInt_AS_LONG(o);
29179 x = PyNumber_Index(o);
29181 ival = PyInt_AsLong(x);
29186 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
29187 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29189 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
29190 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.